mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Fixes the broken shell detection
This commit is contained in:
parent
3825b94a09
commit
87bb095d4f
1 changed files with 4 additions and 3 deletions
|
|
@ -13,11 +13,12 @@ export const knownAikidoTools = [
|
||||||
export function doesExecutableExistOnSystem(executableName) {
|
export function doesExecutableExistOnSystem(executableName) {
|
||||||
try {
|
try {
|
||||||
if (os.platform() === "win32") {
|
if (os.platform() === "win32") {
|
||||||
spawnSync("where", [executableName], { stdio: "ignore" });
|
const result = spawnSync("where", [executableName], { stdio: "ignore" });
|
||||||
|
return result.status === 0;
|
||||||
} else {
|
} else {
|
||||||
spawnSync("which", [executableName], { stdio: "ignore" });
|
const result = spawnSync("which", [executableName], { stdio: "ignore" });
|
||||||
|
return result.status === 0;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
} catch {
|
} catch {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue