mirror of
https://github.com/stablyai/orca.git
synced 2026-11-02 10:08:13 +00:00
Grok's installer defaults to ~/.grok/bin and only symlinks into ~/.local/bin when that dir is already on PATH. A GUI-launched Orca never looked in ~/.grok/bin, so the Agents page reported Grok as not installed. Append ~/.grok/bin after ~/.vite-plus/bin in the three lists that must stay in step: the packaged PATH seed, the system install-dir lookup fallback, and the POSIX/WSL guest fallback prelude. Fixes #17590 Co-authored-by: brynnclaw <261708852+brynnclaw@users.noreply.github.com>
35 lines
1.6 KiB
TypeScript
35 lines
1.6 KiB
TypeScript
import { join } from 'node:path'
|
||
|
||
/** Lookup-only fallback: prepending system dirs to inherited PATH would reorder the user’s binaries (#18234).
|
||
* Keep system-block order aligned with patchPackagedProcessPath/POSIX_VERSION_MANAGER_BIN_DIRS; cross-block precedence differs
|
||
* for ~/.local/bin, which precedes this fallback but follows seeded system dirs. Do not hoist system paths above version managers.
|
||
* Omit sbin/~/bin and off-darwin /opt/homebrew; Linuxbrew has its own prefix. Include installer-owned .opencode/.vite-plus (#829) and .grok (#17590) bins.
|
||
* Exception: a newly discovered CLI with sibling node may prepend that dir only to its child PATH for runtime pairing (#10932). */
|
||
export function getSystemCliInstallDirectories(
|
||
platform: NodeJS.Platform,
|
||
homePath: string
|
||
): string[] {
|
||
// Both lookup and seeded system blocks cover POSIX only; Windows installer paths remain outside this fallback.
|
||
if (platform === 'win32') {
|
||
return []
|
||
}
|
||
const directories: string[] = []
|
||
if (platform === 'darwin') {
|
||
// Apple Silicon Homebrew; Intel Homebrew shares /usr/local with npm's prefix.
|
||
directories.push('/opt/homebrew/bin')
|
||
}
|
||
directories.push('/usr/local/bin')
|
||
if (platform === 'linux') {
|
||
// Avoid phantom snap/Linuxbrew probes off Linux, matching seeded PATH.
|
||
directories.push('/snap/bin', '/home/linuxbrew/.linuxbrew/bin')
|
||
}
|
||
directories.push(
|
||
'/nix/var/nix/profiles/default/bin',
|
||
join(homePath, '.nix-profile', 'bin'),
|
||
join(homePath, '.opencode', 'bin'),
|
||
join(homePath, '.vite-plus', 'bin'),
|
||
join(homePath, '.grok', 'bin')
|
||
)
|
||
return directories
|
||
}
|