Skip to content

Commit 4c0b34e

Browse files
namitoyokota3cp
authored andcommitted
Add quotation around executable path.
1 parent 148fe0c commit 4c0b34e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/package-managers/base-package-manager.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ exports.BasePackageManager = class {
1111
}
1212

1313
run(command, args = [], workingDirectory = process.cwd()) {
14+
const isWindows = process.platform === "win32";
15+
let executable = this.getExecutablePath(workingDirectory);
1416
let options = { stdio: "inherit", cwd: workingDirectory };
15-
if (process.platform === "win32") {
17+
if (isWindows) {
18+
executable = `"${executable}"`
1619
options = { ...options, shell: true }
1720
}
1821

1922
return new Promise((resolve, reject) => {
2023
this.proc = spawn(
21-
this.getExecutablePath(workingDirectory),
24+
executable,
2225
[command, ...args],
2326
options
2427
)

0 commit comments

Comments
 (0)