Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMaximilian Antoni <mail@maxantoni.de>2015-03-30 23:35:27 +0300
committerForrest L Norvell <forrest@npmjs.com>2015-04-03 08:15:16 +0300
commit78005ebb6f4103c20f077669c3929b7ea46a4c0d (patch)
tree167c8273f33fe9f9ce917d6c4e6a07062e95cf0b /lib
parent91f5cb1fb91520fbe25a4da5b80848ed540b9ad3 (diff)
run-script: always quote args
Fixes #7743.
Diffstat (limited to 'lib')
-rw-r--r--lib/run-script.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/run-script.js b/lib/run-script.js
index b6aa5fe7e..bf72bf814 100644
--- a/lib/run-script.js
+++ b/lib/run-script.js
@@ -189,8 +189,7 @@ function run (pkg, wd, cmd, args, cb) {
function joinArgs (args) {
var joinedArgs = ""
args.forEach(function(arg) {
- if (arg.match(/[ '"]/)) arg = '"' + arg.replace(/"/g, '\\"') + '"'
- joinedArgs += " " + arg
+ joinedArgs += ' "' + arg.replace(/"/g, '\\"') + '"'
})
return joinedArgs
}