Skip to content

Commit

Permalink
Quote file path
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjohnsonpint committed Jan 8, 2025
1 parent b0a0013 commit 11b2915
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli/src/util/cp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ 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) {
file = `"${file}"`;
}

cp.execFile(file, args, options, (error, stdout, stderr) => {
if (typeof stdout !== "string") stdout = stdout.toString();
if (typeof stderr !== "string") stderr = stderr.toString();
Expand Down

0 comments on commit 11b2915

Please sign in to comment.