diff --git a/plugins/c9.ide.run/output.js b/plugins/c9.ide.run/output.js index 506a4413..101fd60e 100644 --- a/plugins/c9.ide.run/output.js +++ b/plugins/c9.ide.run/output.js @@ -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; diff --git a/plugins/c9.ide.run/run.js b/plugins/c9.ide.run/run.js index 4e28009e..1b48bed6 100644 --- a/plugins/c9.ide.run/run.js +++ b/plugins/c9.ide.run/run.js @@ -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);