mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
fix: /ide install failed to run on Windows (#957)
This commit is contained in:
@@ -916,17 +916,9 @@ export const AppContainer = (props: AppContainerProps) => {
|
|||||||
(result: IdeIntegrationNudgeResult) => {
|
(result: IdeIntegrationNudgeResult) => {
|
||||||
if (result.userSelection === 'yes') {
|
if (result.userSelection === 'yes') {
|
||||||
handleSlashCommand('/ide install');
|
handleSlashCommand('/ide install');
|
||||||
settings.setValue(
|
settings.setValue(SettingScope.User, 'ide.hasSeenNudge', true);
|
||||||
SettingScope.User,
|
|
||||||
'hasSeenIdeIntegrationNudge',
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
} else if (result.userSelection === 'dismiss') {
|
} else if (result.userSelection === 'dismiss') {
|
||||||
settings.setValue(
|
settings.setValue(SettingScope.User, 'ide.hasSeenNudge', true);
|
||||||
SettingScope.User,
|
|
||||||
'hasSeenIdeIntegrationNudge',
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
setIdePromptAnswered(true);
|
setIdePromptAnswered(true);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -112,14 +112,19 @@ describe('ide-installer', () => {
|
|||||||
platform: 'linux',
|
platform: 'linux',
|
||||||
});
|
});
|
||||||
await installer.install();
|
await installer.install();
|
||||||
|
|
||||||
|
// Note: The implementation uses process.platform, not the mocked platform
|
||||||
|
const isActuallyWindows = process.platform === 'win32';
|
||||||
|
const expectedCommand = isActuallyWindows ? '"code"' : 'code';
|
||||||
|
|
||||||
expect(child_process.spawnSync).toHaveBeenCalledWith(
|
expect(child_process.spawnSync).toHaveBeenCalledWith(
|
||||||
'code',
|
expectedCommand,
|
||||||
[
|
[
|
||||||
'--install-extension',
|
'--install-extension',
|
||||||
'qwenlm.qwen-code-vscode-ide-companion',
|
'qwenlm.qwen-code-vscode-ide-companion',
|
||||||
'--force',
|
'--force',
|
||||||
],
|
],
|
||||||
{ stdio: 'pipe' },
|
{ stdio: 'pipe', shell: isActuallyWindows },
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -117,15 +117,16 @@ class VsCodeInstaller implements IdeInstaller {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isWindows = process.platform === 'win32';
|
||||||
try {
|
try {
|
||||||
const result = child_process.spawnSync(
|
const result = child_process.spawnSync(
|
||||||
commandPath,
|
isWindows ? `"${commandPath}"` : commandPath,
|
||||||
[
|
[
|
||||||
'--install-extension',
|
'--install-extension',
|
||||||
'qwenlm.qwen-code-vscode-ide-companion',
|
'qwenlm.qwen-code-vscode-ide-companion',
|
||||||
'--force',
|
'--force',
|
||||||
],
|
],
|
||||||
{ stdio: 'pipe' },
|
{ stdio: 'pipe', shell: isWindows },
|
||||||
);
|
);
|
||||||
|
|
||||||
if (result.status !== 0) {
|
if (result.status !== 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user