()
| 49 | |
| 50 | /** @internal */ |
| 51 | export function isDirenvAvailable(): boolean { |
| 52 | if (os.platform() === 'win32') { |
| 53 | return false |
| 54 | } |
| 55 | |
| 56 | try { |
| 57 | const result = spawnSync('sh', ['-c', 'command -v direnv'], { |
| 58 | encoding: 'utf-8', |
| 59 | timeout: 2000, |
| 60 | }) |
| 61 | return result.status === 0 && result.stdout.trim().length > 0 |
| 62 | } catch { |
| 63 | return false |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | /** @internal */ |
| 68 | export function getDirenvExport(envrcDir: string): Record<string, string | null> | null { |
no outgoing calls
no test coverage detected