Skip to content

Commit

Permalink
fix: get pkgManager compatible edge case (#1078)
Browse files Browse the repository at this point in the history
  • Loading branch information
btea authored Aug 13, 2023
1 parent c596873 commit 0d4a0ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/create-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ async function init() {

write('package.json', JSON.stringify(pkg, null, 2))

const pkgManager = (/pnpm/.test(process.env.npm_execpath) || /pnpm/.test(process.env.npm_config_user_agent))
const pkgManager = (/pnpm/.test(process.env.npm_execpath || '') || /pnpm/.test(process.env.npm_config_user_agent || ''))
? 'pnpm'
: /yarn/.test(process.env.npm_execpath) ? 'yarn' : 'npm'
: /yarn/.test(process.env.npm_execpath || '') ? 'yarn' : 'npm'

const related = path.relative(cwd, root)

Expand Down

0 comments on commit 0d4a0ac

Please sign in to comment.