Skip to content

Commit ef1445f

Browse files
authored
Merge pull request #1 from jparet/jparet-patch-1
Overdrive the default args with the customed ones
2 parents ebf87ac + d224ee9 commit ef1445f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lib/runner.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,21 @@ export default class Runner {
149149
}
150150

151151
args(codeContext, extraArgs) {
152-
let args = (this.scriptOptions.cmdArgs.concat(extraArgs)).concat(this.scriptOptions.scriptArgs);
152+
// extraArgs = default command args from:
153+
// - the grammars/<grammar>.coffee file
154+
155+
// cmdArgs = customed command args from:
156+
// - a user's profil
157+
// - the 'Configure Run Options' panel
158+
let cmdArgs = this.scriptOptions.cmdArgs;
159+
160+
// Let's overdrive the default args with the customed ones
161+
let args = (cmdArgs.length) ? cmdArgs : extraArgs;
162+
163+
// Do not forget to concat the script args after the command args
164+
let scriptArgs = this.scriptOptions.scriptArgs;
165+
args = args.concat(scriptArgs);
166+
153167
const projectPath = this.getProjectPath || '';
154168
args = (args.map(arg => this.fillVarsInArg(arg, codeContext, projectPath)));
155169

0 commit comments

Comments
 (0)