Skip to content

Commit

Permalink
fix(init): use yarn as package manager when calling init with `np…
Browse files Browse the repository at this point in the history
…x` (#2216)
  • Loading branch information
szymonrybczak authored Dec 19, 2023
1 parent 3945227 commit 3906b90
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/cli/src/commands/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,16 +331,8 @@ async function createProject(
function userAgentPackageManager() {
const userAgent = process.env.npm_config_user_agent;

if (userAgent) {
if (userAgent.startsWith('yarn')) {
return 'yarn';
}
if (userAgent.startsWith('npm')) {
return 'npm';
}
if (userAgent.startsWith('bun')) {
return 'bun';
}
if (userAgent && userAgent.startsWith('bun')) {
return 'bun';
}

return null;
Expand Down

0 comments on commit 3906b90

Please sign in to comment.