From 0b5503ba1d307ce479828115e7f4324013579d70 Mon Sep 17 00:00:00 2001 From: Matt Johnson-Pint Date: Thu, 9 Jan 2025 15:56:03 -0800 Subject: [PATCH] . --- cli/src/util/cp.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/src/util/cp.ts b/cli/src/util/cp.ts index 268e6a9c9..4e5cbce36 100644 --- a/cli/src/util/cp.ts +++ b/cli/src/util/cp.ts @@ -9,6 +9,7 @@ import util from "node:util"; import cp from "node:child_process"; +import path from "node:path"; /** * Promisified version of `child_process.execFile`. @@ -27,7 +28,7 @@ export { exec }; */ export async function execFileWithExitCode(file: string, args?: string[], options?: cp.ExecFileOptions): Promise<{ stdout: string; stderr: string; exitCode: number }> { return new Promise((resolve, reject) => { - if (options?.shell) { + if (options?.shell && path.isAbsolute(file)) { file = `"${file}"`; }