🐛 fix(vscode): GUI 下解析 claude 绝对路径(含 ~/.local/bin 官方安装)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { resolveClaudeBin } from './claudeBin'
|
||||
|
||||
/**
|
||||
* Single source of truth for the `claude` (cc) terminal launch command.
|
||||
*
|
||||
@@ -20,8 +22,12 @@ export interface CcCommandOpts {
|
||||
prompt?: string
|
||||
}
|
||||
|
||||
function quoteIfNeeded(bin: string): string {
|
||||
return bin.includes(' ') ? `'${bin}'` : bin
|
||||
}
|
||||
|
||||
export function buildCcCommand(opts: CcCommandOpts): string {
|
||||
const parts = ['claude']
|
||||
const parts = [quoteIfNeeded(resolveClaudeBin() ?? 'claude')]
|
||||
if (opts.effort)
|
||||
parts.push(`--effort ${opts.effort}`)
|
||||
parts.push('--dangerously-skip-permissions', `--settings '${opts.profilePath}'`)
|
||||
|
||||
Reference in New Issue
Block a user