MCPcopy Create free account
hub / github.com/ConardLi/easy-llm-cli / commandExists

Function commandExists

scripts/sandbox_command.js:72–88  ·  view source on GitHub ↗
(cmd)

Source from the content-addressed store, hash-verified

70geminiSandbox = (geminiSandbox || '').toLowerCase();
71
72const commandExists = (cmd) => {
73 const checkCommand = os.platform() === 'win32' ? 'where' : 'command -v';
74 try {
75 execSync(`${checkCommand} ${cmd}`, { stdio: 'ignore' });
76 return true;
77 } catch {
78 if (os.platform() === 'win32') {
79 try {
80 execSync(`${checkCommand} ${cmd}.exe`, { stdio: 'ignore' });
81 return true;
82 } catch {
83 return false;
84 }
85 }
86 return false;
87 }
88};
89
90let command = '';
91if (['1', 'true'].includes(geminiSandbox)) {

Callers 1

sandbox_command.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected