mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-21 06:02:13 +00:00
fix: tighten executable path coverage
This commit is contained in:
@@ -60,7 +60,9 @@ export function resolveExecutablePath(
|
||||
rawExecutable: string,
|
||||
options?: { cwd?: string; env?: NodeJS.ProcessEnv },
|
||||
): string | undefined {
|
||||
const expanded = rawExecutable.startsWith("~") ? expandHomePrefix(rawExecutable) : rawExecutable;
|
||||
const expanded = rawExecutable.startsWith("~")
|
||||
? expandHomePrefix(rawExecutable, { env: options?.env })
|
||||
: rawExecutable;
|
||||
if (expanded.includes("/") || expanded.includes("\\")) {
|
||||
if (path.isAbsolute(expanded)) {
|
||||
return isExecutableFile(expanded) ? expanded : undefined;
|
||||
|
||||
Reference in New Issue
Block a user