Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

shx

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shx - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

lib/config.js

2

lib/cli.js
#!/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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc