diff options
Diffstat (limited to 'lib/utils/command.js')
-rw-r--r-- | lib/utils/command.js | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/lib/utils/command.js b/lib/utils/command.js index 93df750..083e72e 100644 --- a/lib/utils/command.js +++ b/lib/utils/command.js @@ -1,4 +1,3 @@ -var _ = require('lodash'); var childProcess = require('child_process'); var spawn = require('spawn-cmd').spawn; var Promise = require('./promise'); @@ -62,15 +61,22 @@ function escapeShellArg(s) { } function optionsToShellArgs(options) { - return _.chain(options) - .map(function(value, key) { - if (value === null || value === undefined || value === false) return null; - if (value === true) return key; - return key + '=' + escapeShellArg(value); - }) - .compact() - .value() - .join(' '); + var result = []; + + for (var key in options) { + var value = options[key]; + + if (value === null || value === undefined || value === false) { + continue; + } + if (value === true) { + result.push(key); + } + + result.push(key + '=' + escapeShellArg(value)); + } + + return result.join(' '); } module.exports = { |