Skip to content

Commit 2036d63

Browse files
authored
fix(CommandLineArgs): cliArgs not being passed to command if settings.outputTo was not the terminal (#94)
1 parent 78daf49 commit 2036d63

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/services/taskfile.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,14 @@ class TaskfileService {
244244
log.info(`Running task: "${taskName}" in: "${dir}"`);
245245

246246
// Spawn a child process
247-
let child = cp.spawn(this.command(), [taskName], { cwd: dir });
247+
let args = [];
248+
if (cliArgs === undefined) {
249+
args = [taskName];
250+
} else {
251+
args = [taskName, "--", `${cliArgs}`];
252+
}
253+
254+
let child = cp.spawn(this.command(), args, { cwd: dir });
248255

249256
// Open the output
250257
TaskfileService.outputChannel.clear();

0 commit comments

Comments
 (0)