fix(core): Use shell for spawn on Windows (#9995)

This commit is contained in:
Gal Zahavi
2025-10-08 14:21:23 -07:00
committed by GitHub
parent 8d8a2ab64e
commit 741b57ed06
6 changed files with 41 additions and 9 deletions
+18 -1
View File
@@ -119,7 +119,24 @@ describe('ide-installer', () => {
'google.gemini-cli-vscode-ide-companion',
'--force',
],
{ stdio: 'pipe' },
{ stdio: 'pipe', shell: false },
);
});
it('installs the extension using code cli on windows', async () => {
const { installer } = setup({
platform: 'win32',
execSync: () => 'C:\\Program Files\\Microsoft VS Code\\bin\\code.cmd',
});
await installer.install();
expect(child_process.spawnSync).toHaveBeenCalledWith(
'C:\\Program Files\\Microsoft VS Code\\bin\\code.cmd',
[
'--install-extension',
'google.gemini-cli-vscode-ide-companion',
'--force',
],
{ stdio: 'pipe', shell: true },
);
});
+1 -1
View File
@@ -125,7 +125,7 @@ class VsCodeInstaller implements IdeInstaller {
'google.gemini-cli-vscode-ide-companion',
'--force',
],
{ stdio: 'pipe' },
{ stdio: 'pipe', shell: this.platform === 'win32' },
);
if (result.status !== 0) {