Skip to content

Commit

Permalink
fixes wsl spawn bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ecmel committed Dec 16, 2024
1 parent 82f3a31 commit 0adc735
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function checkOpenSslInstalled(): Promise<string | null> {
try {
const result = await tryExecuteCommand(
undefined,
"openSsl",
"openssl",
log,
"version",
);
Expand Down
10 changes: 9 additions & 1 deletion src/utils/cpUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,16 @@ export async function tryExecuteCommand(
let childProc: cp.ChildProcess;
if (process.platform === "darwin") {
// need to send the escaped working directory and command together for MacOS
workingDirectory = workingDirectory.replace(/(\s+)/g, "\\ ");
workingDirectory = workingDirectory.replace(/\s/g, "\\ ");
childProc = cp.spawn(join(workingDirectory, command), args, options);
} else if (process.platform === "linux") {
childProc = cp.spawn(
workingDirectory === os.tmpdir()
? command
: join(workingDirectory, command),
args,
options,
);
} else {
childProc = cp.spawn(command, args, options);
}
Expand Down

0 comments on commit 0adc735

Please sign in to comment.