mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
# 🚀 Sync Gemini CLI v0.2.1 - Major Feature Update (#483)
This commit is contained in:
@@ -26,13 +26,22 @@ export interface InstallResult {
|
||||
async function findVsCodeCommand(): Promise<string | null> {
|
||||
// 1. Check PATH first.
|
||||
try {
|
||||
child_process.execSync(
|
||||
process.platform === 'win32'
|
||||
? `where.exe ${VSCODE_COMMAND}`
|
||||
: `command -v ${VSCODE_COMMAND}`,
|
||||
{ stdio: 'ignore' },
|
||||
);
|
||||
return VSCODE_COMMAND;
|
||||
if (process.platform === 'win32') {
|
||||
const result = child_process
|
||||
.execSync(`where.exe ${VSCODE_COMMAND}`)
|
||||
.toString()
|
||||
.trim();
|
||||
// `where.exe` can return multiple paths. Return the first one.
|
||||
const firstPath = result.split(/\r?\n/)[0];
|
||||
if (firstPath) {
|
||||
return firstPath;
|
||||
}
|
||||
} else {
|
||||
child_process.execSync(`command -v ${VSCODE_COMMAND}`, {
|
||||
stdio: 'ignore',
|
||||
});
|
||||
return VSCODE_COMMAND;
|
||||
}
|
||||
} catch {
|
||||
// Not in PATH, continue to check common locations.
|
||||
}
|
||||
@@ -59,7 +68,7 @@ async function findVsCodeCommand(): Promise<string | null> {
|
||||
// Windows
|
||||
locations.push(
|
||||
path.join(
|
||||
process.env.ProgramFiles || 'C:\\Program Files',
|
||||
process.env['ProgramFiles'] || 'C:\\Program Files',
|
||||
'Microsoft VS Code',
|
||||
'bin',
|
||||
'code.cmd',
|
||||
@@ -97,7 +106,7 @@ class VsCodeInstaller implements IdeInstaller {
|
||||
if (!commandPath) {
|
||||
return {
|
||||
success: false,
|
||||
message: `VS Code CLI not found. Please ensure 'code' is in your system's PATH. For help, see https://code.visualstudio.com/docs/configure/command-line#_code-is-not-recognized-as-an-internal-or-external-command. You can also install the companion extension manually from the VS Code marketplace.`,
|
||||
message: `VS Code CLI not found. Please ensure 'code' is in your system's PATH. For help, see https://code.visualstudio.com/docs/configure/command-line#_code-is-not-recognized-as-an-internal-or-external-command. You can also install the '${QWEN_CODE_COMPANION_EXTENSION_NAME}' extension manually from the VS Code marketplace.`,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -106,8 +115,7 @@ class VsCodeInstaller implements IdeInstaller {
|
||||
child_process.execSync(command, { stdio: 'pipe' });
|
||||
return {
|
||||
success: true,
|
||||
message:
|
||||
'VS Code companion extension was installed successfully. Please restart your terminal to complete the setup.',
|
||||
message: 'VS Code companion extension was installed successfully.',
|
||||
};
|
||||
} catch (_error) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user