fix(cpa): more package manager detection improvements (#6566)

- Adjust package manager detection logic
- Remove pnpm-lock.yaml from blank template
This commit is contained in:
Elliot DeNolf
2024-05-30 09:35:53 -04:00
committed by GitHub
parent 8b49402e4c
commit 0d7d3e5c92
2 changed files with 3 additions and 7149 deletions

View File

@@ -18,11 +18,12 @@ export async function getPackageManager(args: {
) {
detected = 'pnpm'
} else if (
(cliArgs?.['--use-yarn'] && fse.existsSync(`${projectDir}/yarn.lock`)) ||
cliArgs?.['--use-yarn'] ||
fse.existsSync(`${projectDir}/yarn.lock`) ||
(await commandExists('yarn'))
) {
detected = 'yarn'
} else if (cliArgs?.['--use-npm'] && fse.existsSync(`${projectDir}/package-lock.json`)) {
} else if (cliArgs?.['--use-npm'] || fse.existsSync(`${projectDir}/package-lock.json`)) {
detected = 'npm'
}
return detected || 'npm'

File diff suppressed because it is too large Load Diff