Skip to content

Commit

Permalink
Merge pull request #480 from KxSystems/ee-wsl
Browse files Browse the repository at this point in the history
Fix for WSL spawn bug
  • Loading branch information
ecmel authored Dec 17, 2024
2 parents 31b5097 + 0adc735 commit 2cd3916
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 2cd3916

Please sign in to comment.