Skip to content

Commit 2cd3916

Browse files
authored
Merge pull request #480 from KxSystems/ee-wsl
Fix for WSL spawn bug
2 parents 31b5097 + 0adc735 commit 2cd3916

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/utils/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export async function checkOpenSslInstalled(): Promise<string | null> {
4141
try {
4242
const result = await tryExecuteCommand(
4343
undefined,
44-
"openSsl",
44+
"openssl",
4545
log,
4646
"version",
4747
);

src/utils/cpUtils.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,16 @@ export async function tryExecuteCommand(
6666
let childProc: cp.ChildProcess;
6767
if (process.platform === "darwin") {
6868
// need to send the escaped working directory and command together for MacOS
69-
workingDirectory = workingDirectory.replace(/(\s+)/g, "\\ ");
69+
workingDirectory = workingDirectory.replace(/\s/g, "\\ ");
7070
childProc = cp.spawn(join(workingDirectory, command), args, options);
71+
} else if (process.platform === "linux") {
72+
childProc = cp.spawn(
73+
workingDirectory === os.tmpdir()
74+
? command
75+
: join(workingDirectory, command),
76+
args,
77+
options,
78+
);
7179
} else {
7280
childProc = cp.spawn(command, args, options);
7381
}

0 commit comments

Comments
 (0)