MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / discoverNodeFromShell

Function discoverNodeFromShell

desktop/runtime-host/client-environment.ts:72–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70}
71
72async function discoverNodeFromShell() {
73 const shells = [
74 getProcessEnvironmentVariable('SHELL'),
75 '/bin/bash',
76 '/bin/zsh',
77 '/bin/sh',
78 ].filter((shell): shell is string => Boolean(shell))
79 for (const shell of [...new Set(shells)]) {
80 if (!isExecutableFile(shell)) continue
81 const candidate = await runShellNodeProbe(shell)
82 if (candidate) return candidate
83 }
84 return null
85}
86
87export async function getNodeExecutable() {
88 if (cachedNodeExecutable) return cachedNodeExecutable

Callers 1

getNodeExecutableFunction · 0.85

Calls 3

runShellNodeProbeFunction · 0.85
isExecutableFileFunction · 0.70

Tested by

no test coverage detected