kopia lustrzana https://github.com/c9/core
fix quoting of args in runner.script
rodzic
58b6fa3d98
commit
6d29c6b3dc
|
@ -350,6 +350,8 @@ define(function(require, exports, module) {
|
|||
continue;
|
||||
}
|
||||
if (c === " ") {
|
||||
if (!results.raw)
|
||||
results.raw = pathArgs.substr(i);
|
||||
if (lastStart < i)
|
||||
results.push(pathArgs.substring(lastStart, i));
|
||||
lastStart = i + 1;
|
||||
|
|
|
@ -328,7 +328,7 @@ define(function(require, module, exports) {
|
|||
cmd += typeof runner.script == "string" ? runner.script : runner.script.join("\n");
|
||||
var matches = cmd.match(/\$[\w\-]+/g) || [];
|
||||
var argRe = /\$args(?=\s|$|[&|>;])/g;
|
||||
var seen = { args: argRe.test(cmd) };
|
||||
var seen = { $args: true };
|
||||
cmd = matches.map(function(key) {
|
||||
if (seen[key])
|
||||
return "";
|
||||
|
@ -339,7 +339,7 @@ define(function(require, module, exports) {
|
|||
return key.slice(1) + "=" + bashQuote([val]) + ";";
|
||||
}).join("") + "\n" + cmd;
|
||||
// handle args separately to allow passing multiple arguments, or piping the output
|
||||
cmd = cmd.replace(argRe, options.args);
|
||||
cmd = cmd.replace(argRe, options.args && options.args.raw || getVariable("args", options));
|
||||
} else {
|
||||
// @todo add argument escaping
|
||||
cmd += bashQuote(options.debug && runner["cmd-debug"] || runner.cmd);
|
||||
|
|
Ładowanie…
Reference in New Issue