mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-01 09:49:03 +08:00
fix(codetool): quote executable path to handle spaces (#9519)
* fix(cmd): quote executable path on Windows in command string Wrap the executable path in double quotes when running on Windows sopaths containing spaces are handled correctly. Previously the base command used an unquoted path which could break execution for users whose install location includes spaces. This change only alters the Windows branch to produce a quoted executable path while keeping the non-Windows command unchanged. * fix(codetool): quote bun paths in shell commands to spaces
This commit is contained in:
parent
57702f545d
commit
fd7d2b7580
@ -203,7 +203,7 @@ class CodeToolsService {
|
||||
? `set "BUN_INSTALL=${bunInstallPath}" && set "NPM_CONFIG_REGISTRY=${registryUrl}" &&`
|
||||
: `export BUN_INSTALL="${bunInstallPath}" && export NPM_CONFIG_REGISTRY="${registryUrl}" &&`
|
||||
|
||||
const updateCommand = `${installEnvPrefix} ${bunPath} install -g ${packageName}`
|
||||
const updateCommand = `${installEnvPrefix} "${bunPath}" install -g ${packageName}`
|
||||
logger.info(`Executing update command: ${updateCommand}`)
|
||||
|
||||
await execAsync(updateCommand, { timeout: 60000 })
|
||||
@ -307,7 +307,7 @@ class CodeToolsService {
|
||||
}
|
||||
|
||||
// Build command to execute
|
||||
let baseCommand = isWin ? `${executablePath}` : `${bunPath} ${executablePath}`
|
||||
let baseCommand = isWin ? `"${executablePath}"` : `"${bunPath}" "${executablePath}"`
|
||||
const bunInstallPath = path.join(os.homedir(), '.cherrystudio')
|
||||
|
||||
if (isInstalled) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user