diff --git a/vscode-extensions/vscode-spring-cli/src/cli.ts b/vscode-extensions/vscode-spring-cli/src/cli.ts index 9090825ec..5dfc1bd0d 100644 --- a/vscode-extensions/vscode-spring-cli/src/cli.ts +++ b/vscode-extensions/vscode-spring-cli/src/cli.ts @@ -17,15 +17,15 @@ export class Cli { } projectList() : Promise { - return this.fetch("Fetching projects...", undefined, ["project", "list-json"]); + return this.fetchJson("Fetching projects...", undefined, ["project", "list"]); } projectCatalogList(): Promise { - return this.fetch("Fetching Catalogs...", undefined, ["project-catalog", "list-json"]); + return this.fetchJson("Fetching Catalogs...", undefined, ["project-catalog", "list"]); } projectCatalogListAvailable(): Promise { - return this.fetch("Fetching Available Catalogs...", undefined, ["project-catalog", "list-available-json"]); + return this.fetchJson("Fetching Available Catalogs...", undefined, ["project-catalog", "list-available"]); } projectCatalogAdd(catalog: ProjectCatalog): Promise { @@ -155,7 +155,7 @@ export class Cli { }); } - private async fetch(title: string, message: string, args: string[], cwd?: string) : Promise { + private async fetchJson(title: string, message: string, args: string[], cwd?: string) : Promise { return window.withProgress({ location: ProgressLocation.Window, @@ -172,7 +172,7 @@ export class Cli { reject("Cancelled"); } const processOpts = { cwd: cwd || getWorkspaceRoot()?.fsPath || homedir() }; - const process = this.executable.endsWith(".jar") ? await cp.exec(`java -jar ${this.executable} ${args.join(" ")}`, processOpts) : await cp.exec(`${this.executable} ${args.join(" ")}`, processOpts); + const process = this.executable.endsWith(".jar") ? await cp.exec(`java -jar ${this.executable} ${args.join(" ")} --json`, processOpts) : await cp.exec(`${this.executable} ${args.join(" ")}`, processOpts); cancellation.onCancellationRequested(() => process.kill()); const dataChunks: string[] = []; process.stdout.on("data", s => dataChunks.push(s));