File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -324,17 +324,27 @@ async function init() {
324
324
325
325
if ( customCommand ) {
326
326
const fullCustomCommand = customCommand
327
- . replace ( / ^ n p m c r e a t e / , `${ pkgManager } create` )
327
+ . replace ( / ^ n p m c r e a t e / , ( ) => {
328
+ // `bun create` uses it's own set of templates,
329
+ // the closest alternative is using `bun x` directly on the package
330
+ if ( pkgManager === 'bun' ) {
331
+ return 'bun x create-'
332
+ }
333
+ return `${ pkgManager } create `
334
+ } )
328
335
// Only Yarn 1.x doesn't support `@version` in the `create` command
329
336
. replace ( '@latest' , ( ) => ( isYarn1 ? '' : '@latest' ) )
330
337
. replace ( / ^ n p m e x e c / , ( ) => {
331
- // Prefer `pnpm dlx` or `yarn dlx`
338
+ // Prefer `pnpm dlx`, `yarn dlx`, or `bun x `
332
339
if ( pkgManager === 'pnpm' ) {
333
340
return 'pnpm dlx'
334
341
}
335
342
if ( pkgManager === 'yarn' && ! isYarn1 ) {
336
343
return 'yarn dlx'
337
344
}
345
+ if ( pkgManager === 'bun' ) {
346
+ return 'bun x'
347
+ }
338
348
// Use `npm exec` in all other cases,
339
349
// including Yarn 1.x and other custom npm clients.
340
350
return 'npm exec'
You can’t perform that action at this time.
0 commit comments