Skip to content

Commit

Permalink
Add quotation around executable path.
Browse files Browse the repository at this point in the history
  • Loading branch information
namitoyokota committed Apr 22, 2024
1 parent cd0773d commit 4f37086
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/package-managers/base-package-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ exports.BasePackageManager = class {
}

run(command, args = [], workingDirectory = process.cwd()) {
const isWindows = process.platform === "win32";
let executable = this.getExecutablePath(workingDirectory);
let options = { stdio: "inherit", cwd: workingDirectory };
if (process.platform === "win32") {
if (isWindows) {
executable = `"${executable}"`
options = { ...options, shell: true }
}

return new Promise((resolve, reject) => {
this.proc = spawn(
this.getExecutablePath(workingDirectory),
executable,
[command, ...args],
options
)
Expand Down

0 comments on commit 4f37086

Please sign in to comment.