MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / isExecutable

Function isExecutable

src/utils/Shell.ts:51–69  ·  view source on GitHub ↗
(shellPath: string)

Source from the content-addressed store, hash-verified

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

Callers 1

findSuitableShellFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected