change line endings, step 1
This commit is contained in:
parent
1823415beb
commit
00abe297df
3 changed files with 1 additions and 49 deletions
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
* text=auto
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
require("../cli")
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
var fs = require("fs")
|
|
||||||
var path = require("path")
|
|
||||||
|
|
||||||
var o = require("../ospec")
|
|
||||||
|
|
||||||
function traverseDirectory(pathname, callback) {
|
|
||||||
pathname = pathname.replace(/\\/g, "/")
|
|
||||||
return new Promise(function(resolve, reject) {
|
|
||||||
fs.lstat(pathname, function(err, stat) {
|
|
||||||
if (err) reject(err)
|
|
||||||
if (stat.isDirectory()) {
|
|
||||||
fs.readdir(pathname, function(err, pathnames) {
|
|
||||||
if (err) reject(err)
|
|
||||||
var promises = []
|
|
||||||
for (var i = 0; i < pathnames.length; i++) {
|
|
||||||
pathnames[i] = path.join(pathname, pathnames[i])
|
|
||||||
promises.push(traverseDirectory(pathnames[i], callback))
|
|
||||||
}
|
|
||||||
callback(pathname, stat, pathnames)
|
|
||||||
resolve(Promise.all(promises))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
callback(pathname, stat)
|
|
||||||
resolve(pathname)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
traverseDirectory(".", function(pathname, stat, children) {
|
|
||||||
if (pathname.indexOf("node_modules") > -1) return
|
|
||||||
if (pathname.match(/(?:^|\/)tests\/.*\.js$/)) {
|
|
||||||
require(path.normalize(process.cwd()) + "/" + pathname)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(o.run)
|
|
||||||
.catch(function(e) {
|
|
||||||
console.log(e.stack)
|
|
||||||
})
|
|
||||||
|
|
||||||
process.on("unhandledRejection", function(e) {
|
|
||||||
console.log("Uncaught (in promise) " + e.stack)
|
|
||||||
})
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue