diff --git a/src/features/chat/chat.controller.ts b/src/features/chat/chat.controller.ts index fa365d7..4a61990 100644 --- a/src/features/chat/chat.controller.ts +++ b/src/features/chat/chat.controller.ts @@ -45,14 +45,14 @@ export class ChatController { async hasCli(): Promise { const command = this.resolveSetting(readSettings().command); return new Promise((resolve) => { - cp.exec(`"${command}" --help`, (error) => resolve(!error)); + cp.execFile(command, ["--help"], { timeout: 5000 }, (error) => resolve(!error)); }); } async checkCliVersion(): Promise { const command = this.resolveSetting(readSettings().command); const current = await new Promise((resolve) => { - cp.exec(`"${command}" --version`, (error, stdout) => { + cp.execFile(command, ["--version"], { timeout: 5000 }, (error, stdout) => { resolve(error ? null : parseVersionOutput(stdout)); }); });