Skip to content

Commit 1a300a5

Browse files
committed
feat: support bun create
1 parent ad8194a commit 1a300a5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ function getCommand(packageManager: string, scriptName: string) {
164164
return packageManager === 'yarn' ? 'yarn' : `${packageManager} install`
165165
}
166166

167-
return packageManager === 'npm' ?
168-
`npm run ${scriptName}`
167+
return ['npm', 'bun'].includes(packageManager) ?
168+
`${packageManager} run ${scriptName}`
169169
: `${packageManager} ${scriptName}`
170170
}
171171

@@ -405,6 +405,7 @@ async function init() {
405405
const packageManager =
406406
userAgent.includes('pnpm') ? 'pnpm'
407407
: userAgent.includes('yarn') ? 'yarn'
408+
: userAgent.includes('bun') ? 'bun'
408409
: 'npm'
409410

410411
const render = (templateName: string) => {
@@ -416,7 +417,7 @@ async function init() {
416417
needsStylelint,
417418
needsPrettier,
418419
packageManager:
419-
packageManager === 'npm' ? '' : (
420+
['npm', 'bun'].includes(packageManager) ? '' : (
420421
userAgent.split(' ')[0].replace('/', '@')
421422
),
422423
})

0 commit comments

Comments
 (0)