* Resolve the claude binary path for protocol registration. Prefers the * native installer's stable symlink (~/.local/bin/claude) which survives * auto-updates; falls back to process.execPath when the symlink is absent * (dev builds, non-native installs).
()
| 239 | * (dev builds, non-native installs). |
| 240 | */ |
| 241 | async function resolveClaudePath(): Promise<string> { |
| 242 | const binaryName = process.platform === 'win32' ? 'claude.exe' : 'claude' |
| 243 | const stablePath = path.join(getUserBinDir(), binaryName) |
| 244 | try { |
| 245 | await fs.realpath(stablePath) |
| 246 | return stablePath |
| 247 | } catch { |
| 248 | return process.execPath |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | /** |
| 253 | * Check whether the OS-level protocol handler is already registered AND |
no test coverage detected