Comparing version 0.1.2 to 0.1.3
@@ -13,2 +13,6 @@ #!/usr/bin/env node | ||
var _minimist = require('minimist'); | ||
var _minimist2 = _interopRequireDefault(_minimist); | ||
var _help = require('./help'); | ||
@@ -31,9 +35,9 @@ | ||
var shx = exports.shx = function shx(argv) { | ||
var _argv$slice = argv.slice(2); | ||
var parsedArgs = (0, _minimist2.default)(argv.slice(2), { stopEarly: true, boolean: true }); | ||
var _argv$slice2 = _toArray(_argv$slice); | ||
var _parsedArgs$_ = _toArray(parsedArgs._); | ||
var fnName = _argv$slice2[0]; | ||
var fnName = _parsedArgs$_[0]; | ||
var args = _argv$slice2.slice(1); | ||
var args = _parsedArgs$_.slice(1); | ||
@@ -57,3 +61,27 @@ if (!fnName) { | ||
var ret = _shelljs2.default[fnName].apply(_shelljs2.default, _toConsumableArray(args)); | ||
// Set shell.config with parsed options | ||
Object.assign(_shelljs2.default.config, parsedArgs); | ||
// Workaround for sed syntax | ||
var newArgs = void 0; | ||
var ret = void 0; | ||
if (fnName === 'sed') { | ||
(function () { | ||
newArgs = []; | ||
var lookingForSubstString = true; | ||
args.forEach(function (arg) { | ||
var match = arg.match(/^s\/(.*)\/(.*)\/(g?)$/); | ||
if (match && lookingForSubstString) { | ||
newArgs.push(new RegExp(match[1], match[3])); | ||
newArgs.push(match[2]); | ||
lookingForSubstString = false; | ||
} else { | ||
newArgs.push(arg); | ||
} | ||
}); | ||
ret = _shelljs2.default[fnName].apply(_shelljs2.default, _toConsumableArray(newArgs)); | ||
})(); | ||
} else { | ||
ret = _shelljs2.default[fnName].apply(_shelljs2.default, _toConsumableArray(args)); | ||
} | ||
if (ret === null) ret = _shelljs2.default.ShellString('', '', 1); | ||
@@ -60,0 +88,0 @@ var code = ret.hasOwnProperty('code') && ret.code; |
{ | ||
"name": "shx", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Portable Shell Commands for Node", | ||
@@ -21,5 +21,6 @@ "bin": { | ||
"posttest": "npm run lint --silent", | ||
"release:major": "bash scripts/release.sh major", | ||
"release:minor": "bash scripts/release.sh minor", | ||
"release:patch": "bash scripts/release.sh patch", | ||
"release:major": "shelljs-release major", | ||
"release:minor": "shelljs-release minor", | ||
"release:patch": "shelljs-release patch", | ||
"changelog": "shelljs-changelog", | ||
"test": "nyc --reporter=text --reporter=lcov mocha", | ||
@@ -44,2 +45,3 @@ "test:watch": "concurrently -rk 'npm run test --silent -- -w' 'npm run lint:watch'" | ||
"Ari Porad <ari@ariporad.com> (http://ariporad.com/)", | ||
"Levi Thomason <me@levithomason.com> (https://github.com/levithomason)", | ||
"Nate Fischer <ntfschr@gmail.com>" | ||
@@ -57,18 +59,20 @@ ], | ||
"chai": "^3.5.0", | ||
"codecov": "^1.0.1", | ||
"concurrently": "^2.0.0", | ||
"concurrently": "^2.1.0", | ||
"dirty-chai": "^1.2.2", | ||
"eslint": "^1.10.3", | ||
"eslint-config-airbnb": "^5.0.1", | ||
"eslint-plugin-react": "^3.16.1", | ||
"eslint": "^2.10.1", | ||
"eslint-config-airbnb-base": "^3.0.1", | ||
"eslint-plugin-import": "^1.8.0", | ||
"mocha": "^2.4.5", | ||
"nyc": "^6.4.0", | ||
"rimraf": "^2.5.2", | ||
"shelljs-changelog": "^0.2.0", | ||
"shelljs-release": "^0.2.0", | ||
"sinon": "^1.17.3", | ||
"sinon-chai": "^2.8.0", | ||
"watch": "^0.17.1" | ||
"watch": "^0.18.0" | ||
}, | ||
"dependencies": { | ||
"minimist": "^1.2.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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
13556
8
119
2
17
1
+ Addedminimist@^1.2.0
+ Addedminimist@1.2.8(transitive)