MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / isDirenvAvailable

Function isDirenvAvailable

cli/src/init/init-direnv.ts:51–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49
50/** @internal */
51export 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 */
68export function getDirenvExport(envrcDir: string): Record<string, string | null> | null {

Callers 2

initializeDirenvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected