Skip to content

Commit

Permalink
[config-inferrer] Use 'pnpm' package manager when there is a pnpm-loc…
Browse files Browse the repository at this point in the history
…k.yaml file or the package.json specifies it
  • Loading branch information
jankeromnes authored Jun 17, 2022
1 parent 9552b60 commit 4c8d4cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/server/src/config/config-inferrer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ export class ConfigInferrer {
if (!pckjsonContent) {
return;
}
let command: "yarn" | "npm" = "npm";
let command: "yarn" | "npm" | "pnpm" = "npm";
if (await ctx.exists("yarn.lock")) {
command = "yarn";
}
if (await ctx.exists("pnpm-lock.yaml") || pckjsonContent.packageManager.startsWith("pnpm")) {
command = "pnpm";
}
this.addCommand(ctx.config, command + " install", "init");
try {
const pckjson = JSON.parse(pckjsonContent);
Expand Down

0 comments on commit 4c8d4cb

Please sign in to comment.