mirror of
https://github.com/shelljs/shelljs.git
synced 2026-01-25 16:07:37 +00:00
Merge pull request #252 from bryce-gibson/shjs-exit-code
Support exit code in shjs.
This commit is contained in:
commit
dc5c59be36
8
bin/shjs
8
bin/shjs
@ -37,7 +37,9 @@ if (scriptName.match(/\.coffee$/)) {
|
||||
// CoffeeScript
|
||||
//
|
||||
if (which('coffee')) {
|
||||
exec('coffee "' + scriptName + '" ' + args.join(' '), { async: true });
|
||||
exec('coffee "' + scriptName + '" ' + args.join(' '), function(code) {
|
||||
process.exit(code);
|
||||
});
|
||||
} else {
|
||||
console.log('ShellJS: CoffeeScript interpreter not found');
|
||||
console.log();
|
||||
@ -47,5 +49,7 @@ if (scriptName.match(/\.coffee$/)) {
|
||||
//
|
||||
// JavaScript
|
||||
//
|
||||
exec('node "' + scriptName + '" ' + args.join(' '), { async: true });
|
||||
exec('node "' + scriptName + '" ' + args.join(' '), function(code) {
|
||||
process.exit(code);
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user