Skip to content

Commit f03ef66

Browse files
committed
Update handling of return value from packlist command
1 parent 0617e3e commit f03ef66

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

  • extensions/ql-vscode/src/codeql-cli

extensions/ql-vscode/src/codeql-cli/cli.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,21 +1428,13 @@ export class CodeQLCliServer implements Disposable {
14281428

14291429
async packPacklist(dir: string, includeQueries: boolean): Promise<string[]> {
14301430
const args = includeQueries ? [dir] : ["--no-include-queries", dir];
1431-
// since 2.7.1, packlist returns an object with a "paths" property that is a list of packs.
1432-
// previous versions return a list of packs.
1433-
const results: { paths: string[] } | string[] =
1434-
await this.runJsonCodeQlCliCommand(
1435-
["pack", "packlist"],
1436-
args,
1437-
"Generating the pack list",
1438-
);
1431+
const results: { paths: string[] } = await this.runJsonCodeQlCliCommand(
1432+
["pack", "packlist"],
1433+
args,
1434+
"Generating the pack list",
1435+
);
14391436

1440-
// Once we no longer need to support 2.7.0 or earlier, we can remove this and assume all versions return an object.
1441-
if ("paths" in results) {
1442-
return results.paths;
1443-
} else {
1444-
return results;
1445-
}
1437+
return results.paths;
14461438
}
14471439

14481440
async packResolveDependencies(

0 commit comments

Comments
 (0)