mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 18:50:56 +08:00
fix: ensure correct PATH assignment in shell environment
- Updated the environment variable initialization to use a consistent type. - Added logic to set the PATH variable correctly, ensuring it falls back to existing values if necessary.
This commit is contained in:
parent
446acbc662
commit
7a8870f070
@ -85,7 +85,7 @@ function getLoginShellEnvironment(): Promise<Record<string, string>> {
|
||||
Logger.warn(`Shell process stderr output (even with exit code 0):\n${errorOutput.trim()}`)
|
||||
}
|
||||
|
||||
const env = {}
|
||||
const env: Record<string, string> = {}
|
||||
const lines = output.split('\n')
|
||||
|
||||
lines.forEach((line) => {
|
||||
@ -110,6 +110,8 @@ function getLoginShellEnvironment(): Promise<Record<string, string>> {
|
||||
Logger.warn('Raw output from shell:\n', output)
|
||||
}
|
||||
|
||||
env.PATH = env.Path || env.PATH || ''
|
||||
|
||||
resolve(env)
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user