|
|
|
|
@ -99,7 +99,12 @@ export function isBundledSkillAllowed(entry: SkillEntry, allowlist?: string[]):
|
|
|
|
|
export function hasBinary(bin: string): boolean {
|
|
|
|
|
const pathEnv = process.env.PATH ?? "";
|
|
|
|
|
const parts = pathEnv.split(path.delimiter).filter(Boolean);
|
|
|
|
|
const extensions = process.platform === "win32" ? [".exe", ".cmd", ".bat", ""] : [""];
|
|
|
|
|
const winPathExt = process.env.PATHEXT;
|
|
|
|
|
const winExtensions =
|
|
|
|
|
winPathExt !== undefined
|
|
|
|
|
? winPathExt.split(";").filter(Boolean)
|
|
|
|
|
: [".EXE", ".CMD", ".BAT", ".COM"];
|
|
|
|
|
const extensions = process.platform === "win32" ? ["", ...winExtensions] : [""];
|
|
|
|
|
for (const part of parts) {
|
|
|
|
|
for (const ext of extensions) {
|
|
|
|
|
const candidate = path.join(part, bin + ext);
|
|
|
|
|
|