refactor: packageManager logic for perf improvement

This commit is contained in:
Nitin Kumar 2020-11-07 17:43:38 +05:30
parent c885f6d7dc
commit e827f4fc44
1 changed files with 13 additions and 2 deletions

View File

@ -82,8 +82,19 @@ 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"));
const isNpm = fs.existsSync(path.resolve(process.cwd(), "package-lock.json"));
let isYarn = false;
if (!isNpm) {
isYarn = fs.existsSync(path.resolve(process.cwd(), "yarn.lock"));
}
let isPnpm = false;
if (!isYarn) {
isPnpm = fs.existsSync(path.resolve(process.cwd(), "pnpm-lock.yaml"));
}
let packageManager;