Update shell.js

This commit is contained in:
Namhyeon Go 2020-08-13 15:36:44 +09:00 committed by GitHub
parent 9f01733a5c
commit df57b9f8d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,12 @@ exports.makeCmdLine = function(cmd) {
return cmd;
} else if (typeof(cmd) === "object") {
return cmd.map(function(s) {
return "\"" + exports.addslashes(s) + "\"";
var regex = /[ "]/g;
if (!regex.test(s)) {
return s;
} else {
return "\"" + exports.addslashes(s) + "\"";
}
}).join(' ');
} else {
return "";