Comparing version 0.1.1 to 0.1.2
#!/usr/bin/env node | ||
'use strict'; | ||
require('babel-polyfill'); | ||
var _shx = require('./shx'); | ||
process.exit((0, _shx.shx)(process.argv)); |
@@ -7,3 +7,3 @@ #!/usr/bin/env node | ||
}); | ||
exports.shx = exports.CMD_BLACKLIST = exports.EXIT_CODES = undefined; | ||
exports.shx = undefined; | ||
@@ -14,2 +14,8 @@ var _shelljs = require('shelljs'); | ||
var _help = require('./help'); | ||
var _help2 = _interopRequireDefault(_help); | ||
var _config = require('./config'); | ||
var _printCmdRet = require('./printCmdRet'); | ||
@@ -23,10 +29,4 @@ | ||
var EXIT_CODES = exports.EXIT_CODES = { | ||
SHX_ERROR: 27, // https://xkcd.com/221/ | ||
CMD_FAILED: 1, // TODO: Once shelljs/shelljs#269 lands, use `error()` | ||
SUCCESS: 0 | ||
}; | ||
_shelljs2.default.help = _help2.default; | ||
var CMD_BLACKLIST = exports.CMD_BLACKLIST = ['cd', 'pushd', 'popd', 'dirs', 'set', 'exit', 'exec']; | ||
var shx = exports.shx = function shx(argv) { | ||
@@ -43,3 +43,4 @@ var _argv$slice = argv.slice(2); | ||
console.error('Error: Missing ShellJS command name'); | ||
return EXIT_CODES.SHX_ERROR; | ||
console.error((0, _help2.default)()); | ||
return _config.EXIT_CODES.SHX_ERROR; | ||
} | ||
@@ -50,6 +51,8 @@ | ||
console.error('Error: Invalid ShellJS command: ' + fnName + '.'); | ||
return EXIT_CODES.SHX_ERROR; | ||
} else if (CMD_BLACKLIST.includes(fnName)) { | ||
console.error((0, _help2.default)()); | ||
return _config.EXIT_CODES.SHX_ERROR; | ||
} else if (_config.CMD_BLACKLIST.indexOf(fnName) > -1) { | ||
console.error('Warning: shx ' + fnName + ' is not supported'); | ||
return EXIT_CODES.SHX_ERROR; | ||
console.error('Please run `shx help` for a list of commands.'); | ||
return _config.EXIT_CODES.SHX_ERROR; | ||
} | ||
@@ -70,6 +73,6 @@ | ||
} else if (_shelljs2.default.error()) { | ||
return EXIT_CODES.CMD_FAILED; | ||
return _config.EXIT_CODES.CMD_FAILED; | ||
} | ||
return EXIT_CODES.SUCCESS; | ||
return _config.EXIT_CODES.SUCCESS; | ||
}; |
{ | ||
"name": "shx", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Portable Shell Commands for Node", | ||
@@ -69,5 +69,4 @@ "bin": { | ||
"dependencies": { | ||
"babel-polyfill": "^6.8.0", | ||
"shelljs": "^0.7.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7221
1
7
94
- Removedbabel-polyfill@^6.8.0
- Removedbabel-polyfill@6.26.0(transitive)
- Removedbabel-runtime@6.26.0(transitive)
- Removedcore-js@2.6.12(transitive)
- Removedregenerator-runtime@0.10.50.11.1(transitive)