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

Function isExecutable

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

Source from the content-addressed store, hash-verified

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

Callers 1

findSuitableShellFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected