MCPcopy Create free account
hub / github.com/anus-dev/ANUS / commandExists

Function commandExists

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

Source from the content-addressed store, hash-verified

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

Callers 1

sandbox_command.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected