Skip to content

Commit

Permalink
fix: don't quote executable in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
edusperoni committed Aug 28, 2024
1 parent 25c3d67 commit 823565e
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions lib/base-package-manager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isInteractive, quoteString } from "./common/helpers";
import { isInteractive } from "./common/helpers";
import {
INodePackageManager,
INodePackageManagerInstallOptions,
Expand Down Expand Up @@ -108,19 +108,11 @@ export abstract class BasePackageManager implements INodePackageManager {
): Promise<INpmInstallResultInfo> {
const npmExecutable = this.getPackageManagerExecutableName();
const stdioValue = isInteractive() ? "inherit" : "pipe";
const sanitizedNpmExecutable = this.$hostInfo.isWindows
? quoteString(npmExecutable)
: npmExecutable;
await this.$childProcess.spawnFromEvent(
sanitizedNpmExecutable,
params,
"close",
{
cwd: opts.cwd,
stdio: stdioValue,
shell: this.$hostInfo.isWindows,
}
);
await this.$childProcess.spawnFromEvent(npmExecutable, params, "close", {
cwd: opts.cwd,
stdio: stdioValue,
shell: this.$hostInfo.isWindows,
});

// Whenever calling "npm install" or "yarn add" without any arguments (hence installing all dependencies) no output is emitted on stdout
// Luckily, whenever you call "npm install" or "yarn add" to install all dependencies chances are you won't need the name/version of the package you're installing because there is none.
Expand Down

0 comments on commit 823565e

Please sign in to comment.