Skip to content

Commit 9b9f750

Browse files
committed
fix: bug where only one additional flag gets set
1 parent 65a8222 commit 9b9f750

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/services/taskfile.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,18 @@ class TaskfileService {
180180
public async read(dir: string, nesting: boolean): Promise<Namespace | undefined> {
181181
log.info(`Searching for taskfile in: "${dir}"`);
182182
return await new Promise((resolve, reject) => {
183-
let additionalFlags = "";
184-
// Sorting
183+
let flags = [
184+
"--list-all",
185+
"--json"
186+
];
187+
// Optional flags
185188
if (settings.tree.sort !== TreeSort.default) {
186-
additionalFlags = ` --sort ${settings.tree.sort}`;
189+
flags.push(`--sort ${settings.tree.sort}`);
187190
}
188191
if (nesting) {
189-
additionalFlags = ` --nested`;
192+
flags.push(`--nested`);
190193
}
191-
let command = this.command(`--list-all --json${additionalFlags}`);
194+
let command = this.command(`${flags.join(' ')}`);
192195
cp.exec(command, { cwd: dir }, (err: cp.ExecException | null, stdout: string, stderr: string) => {
193196
if (err) {
194197
log.error(err);

0 commit comments

Comments
 (0)