()
| 101 | * - npm-global (via Homebrew's npm): /opt/homebrew/lib/node_modules/@anthropic-ai/... |
| 102 | */ |
| 103 | export function detectHomebrew(): boolean { |
| 104 | const platform = getPlatform() |
| 105 | |
| 106 | // Homebrew is only for macOS and Linux |
| 107 | if (platform !== 'macos' && platform !== 'linux' && platform !== 'wsl') { |
| 108 | return false |
| 109 | } |
| 110 | |
| 111 | // Get the path of the currently running executable |
| 112 | const execPath = process.execPath || process.argv[0] || '' |
| 113 | |
| 114 | // Check if the executable is within a Homebrew Caskroom directory |
| 115 | // This is specific to Homebrew cask installations |
| 116 | if (execPath.includes('/Caskroom/')) { |
| 117 | logForDebugging(`Detected Homebrew cask installation: ${execPath}`) |
| 118 | return true |
| 119 | } |
| 120 | |
| 121 | return false |
| 122 | } |
| 123 | |
| 124 | /** |
| 125 | * Detects if the currently running Claude instance was installed via winget |
no test coverage detected