Browse Source

Fixes shell parameters quoting after #8349

Yury Delendik 8 years ago
parent
commit
2ac410625b
  1. 7
      gulpfile.js

7
gulpfile.js

@ -88,6 +88,13 @@ function safeSpawnSync(command, parameters, options) { @@ -88,6 +88,13 @@ function safeSpawnSync(command, parameters, options) {
// Execute all commands in a shell.
options = options || {};
options.shell = true;
// `options.shell = true` requires parameters to be quoted.
parameters = parameters.map((param) => {
if (!/[\s`~!#$*(){\[|\\;'"<>?]/.test(param)) {
return param;
}
return '\"' + param.replace(/([$\\"`])/g, '\\$1') + '\"';
});
var result = spawnSync(command, parameters, options);
if (result.status !== 0) {

Loading…
Cancel
Save