Detect Bun package manager in create-astro (#7944)

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This commit is contained in:
Colin McDonnell 2023-08-17 01:35:19 -07:00 committed by GitHub
parent 097a8e4e91
commit dff0f0f8dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'create-astro': patch
---
Update 'dev' command for Bun users

View file

@ -5,7 +5,12 @@ import { nextSteps, say } from '../messages.js';
export async function next(ctx: Pick<Context, 'cwd' | 'pkgManager' | 'skipHouston'>) {
let projectDir = path.relative(process.cwd(), ctx.cwd);
const devCmd = ctx.pkgManager === 'npm' ? 'npm run dev' : `${ctx.pkgManager} dev`;
const devCmd =
ctx.pkgManager === 'npm'
? 'npm run dev'
: ctx.pkgManager === 'bun'
? 'bun run dev'
: `${ctx.pkgManager} dev`;
await nextSteps({ projectDir, devCmd });
if (!ctx.skipHouston) {