MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / isExecutable

Function isExecutable

source code/utils/Shell.ts:52–70  ·  view source on GitHub ↗
(shellPath: string)

Source from the content-addressed store, hash-verified

50}
51
52function isExecutable(shellPath: string): boolean {
53 try {
54 accessSync(shellPath, fsConstants.X_OK)
55 return true
56 } catch (_err) {
57 // Fallback for Nix and other environments where X_OK check might fail
58 try {
59 // Try to execute the shell with --version, which should exit quickly
60 // Use execFileSync to avoid shell injection vulnerabilities
61 execFileSync(shellPath, ['--version'], {
62 timeout: 1000,
63 stdio: 'ignore',
64 })
65 return true
66 } catch {
67 return false
68 }
69 }
70}
71
72/**
73 * Determines the best available shell to use.

Callers 1

findSuitableShellFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected