-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restructure so coverage is more accurate (cli needs more testing)
- Loading branch information
Showing
6 changed files
with
60 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,4 @@ notifications: | |
email: true | ||
|
||
after_script: | ||
- npm run instrument | ||
- npm run coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
module.exports = process.env.SYMLINK_COV | ||
? require('./lib-cov/symlink.js') | ||
: require('./lib/symlink.js'); | ||
module.exports = process.env.SYMLINK_COV ? | ||
require('./lib-cov/symlink.js'): | ||
require('./lib/symlink.js'); | ||
|
||
module.exports.cli = process.env.SYMLINK_COV ? | ||
require('./lib-cov/cli.js'): | ||
require('./lib/cli.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
var cp = require('child_process'); | ||
var path = require('path'); | ||
var async = require('async'); | ||
|
||
var handleError = function (err) { | ||
if (err) { | ||
console.error(err.message); | ||
process.exit(1); | ||
} | ||
}; | ||
|
||
var dryRunHandler = function (err, cmds) { | ||
handleError(err); | ||
console.log(JSON.stringify(cmds, null, " ")); | ||
}; | ||
var executeHandler = function (err, cmds) { | ||
handleError(err); | ||
// create one cp function cmd that execs and cbs to next in async series | ||
var execs = cmds.map(function (cmd) { | ||
return function (cb) { | ||
console.log(cmd); | ||
cp.exec(cmd, function (error, stdout) { | ||
console.log(stdout); | ||
cb(error); | ||
}); | ||
}; | ||
}); | ||
|
||
// exec commands synchronously | ||
async.series(execs, function (err) { | ||
handleError(err); | ||
process.exit(0); | ||
}); | ||
}; | ||
|
||
|
||
exports.run = function (argv) { | ||
// repoDirs are the unnamed arguments (usually just one super dir) | ||
var dirs = argv._.map(function (dir) { | ||
return path.join(process.cwd(), dir); | ||
}); | ||
|
||
// execute main module function with one of the handlers as the cb | ||
var handler = argv.d ? dryRunHandler : executeHandler; | ||
require('./symlink')(dirs, argv.g || [], handler); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,5 +114,4 @@ module.exports = function (dirs, globals, cb) { | |
} | ||
return cb(null, cmds); | ||
}); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters