Skip to content

Commit d152609

Browse files
authored
fix(CommandLineArgs): pass cliArgsInput into runTask (#93)
1 parent 10af8d2 commit d152609

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/task.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@ export class TaskExtension {
128128
prompt: RUNTASKWITHARGS_PROMPT,
129129
placeHolder: RUNTASKWITHARGS_PLACEHOLDER
130130
}).then((cliArgsInput) => {
131-
services.taskfile.runTask(treeItem.task.name, treeItem.workspace);
131+
if (cliArgsInput === undefined) {
132+
vscode.window.showInformationMessage('No Args Supplied');
133+
return;
134+
}
135+
services.taskfile.runTask(treeItem.task.name, treeItem.workspace, cliArgsInput);
132136
});
133137
}
134138
}));

test-workspace/Taskfile.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ tasks:
1313
cmds:
1414
- echo "Hello World"
1515

16+
hello-with-args:
17+
desc: Print custom arguments from Run Task With Args
18+
cmds:
19+
- echo {{.CLI_ARGS}}
20+
1621
internal-task:
1722
desc: A task should not be visible in the tree view or executable
1823
cmds:

0 commit comments

Comments
 (0)