Comparing version 1.0.4 to 1.0.5
// Generated by CoffeeScript 1.10.0 | ||
var argsObject, argsString, isString, isWin, path, ref, shellQuote; | ||
var argsObject, argsString, isString, isWin, path, ref, shellQuote, shellRequired; | ||
@@ -10,7 +10,18 @@ path = require('path'); | ||
argsString = function(s, env) { | ||
var args, cmd, k, ref1, v; | ||
shellRequired = function(args) { | ||
var arg, i, len; | ||
for (i = 0, len = args.length; i < len; i++) { | ||
arg = args[i]; | ||
if (!isString(arg)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
argsString = function(s, opts, env) { | ||
var args, cmd, k, ref1, ref2, v; | ||
args = shellQuote.parse(s); | ||
while (cmd = args.shift()) { | ||
if (cmd.indexOf('=') === -1) { | ||
if ((cmd.indexOf('=')) === -1) { | ||
break; | ||
@@ -21,6 +32,11 @@ } | ||
} | ||
if ((opts.shell != null) || shellRequired(args)) { | ||
console.log('requiredShell'); | ||
cmd = (ref2 = opts.shell) != null ? ref2 : '/bin/sh'; | ||
args = ['-c', s]; | ||
} | ||
return [cmd, args, env]; | ||
}; | ||
argsObject = function(obj, env) { | ||
argsObject = function(obj, opts, env) { | ||
var args, cmd, k, ref1, ref2, v; | ||
@@ -46,5 +62,5 @@ cmd = obj.cmd; | ||
if (isString(args)) { | ||
ref2 = argsString(args, env), cmd = ref2[0], args = ref2[1], env = ref2[2]; | ||
ref2 = argsString(args, opts, env), cmd = ref2[0], args = ref2[1], env = ref2[2]; | ||
} else { | ||
ref3 = argsObject(args, env), cmd = ref3[0], args = ref3[1], env = ref3[2]; | ||
ref3 = argsObject(args, opts, env), cmd = ref3[0], args = ref3[1], env = ref3[2]; | ||
} | ||
@@ -51,0 +67,0 @@ opts.env = env; |
{ | ||
"name": "executive", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Elegant command execution.", | ||
@@ -5,0 +5,0 @@ "main": "lib/", |
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
14482
322