Skip to content

Commit

Permalink
feat: add pnpm support for installing CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Nov 7, 2020
1 parent 7415a61 commit c885f6d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion bin/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,18 @@ if (!cli.installed) {
console.error(notify);

const isYarn = fs.existsSync(path.resolve(process.cwd(), "yarn.lock"));
const isPnpm = fs.existsSync(path.resolve(process.cwd(), "pnpm-lock.yaml"));

let packageManager;

if (isYarn) {
packageManager = "yarn";
} else if (isPnpm) {
packageManager = "pnpm";
} else {
packageManager = "npm";
}

const packageManager = isYarn ? "yarn" : "npm";
const installOptions = [isYarn ? "add" : "install", "-D"];

console.error(
Expand Down
3 changes: 2 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@
"opencollective",
"dependabot",
"browserslist",
"samsunginternet"
"samsunginternet",
"pnpm"
],
"ignoreRegExpList": ["/Author.+/", "/data:.*/", "/\"mappings\":\".+\"/"],
"ignorePaths": ["**/dist/**", "examples/**/README.md"]
Expand Down

0 comments on commit c885f6d

Please sign in to comment.