(command: string)
| 31 | } |
| 32 | |
| 33 | function whichNodeSync(command: string): string | null { |
| 34 | if (process.platform === 'win32') { |
| 35 | try { |
| 36 | const result = execSync_DEPRECATED(`where.exe ${command}`, { |
| 37 | encoding: 'utf-8', |
| 38 | stdio: ['ignore', 'pipe', 'ignore'], |
| 39 | }) |
| 40 | const output = result.toString().trim() |
| 41 | return output.split(/\r?\n/)[0] || null |
| 42 | } catch { |
| 43 | return null |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | try { |
| 48 | const result = execSync_DEPRECATED(`which ${command}`, { |
| 49 | encoding: 'utf-8', |
| 50 | stdio: ['ignore', 'pipe', 'ignore'], |
| 51 | }) |
| 52 | return result.toString().trim() || null |
| 53 | } catch { |
| 54 | return null |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | const bunWhich = |
| 59 | typeof Bun !== 'undefined' && typeof Bun.which === 'function' |
nothing calls this directly
no test coverage detected