@@ -512,6 +512,8 @@ async function init() {
512
512
template = variant
513
513
}
514
514
515
+ const pkgManager = pkgInfo ? pkgInfo . name : 'npm'
516
+
515
517
// 5. Ask about immediate install and package manager
516
518
let immediate = argImmediate
517
519
if ( immediate === undefined ) {
@@ -520,30 +522,13 @@ async function init() {
520
522
immediate = false
521
523
} else {
522
524
const immediateResult = await prompts . confirm ( {
523
- message : ' Install and start now?' ,
525
+ message : ` Install with ${ pkgManager } and start now?` ,
524
526
} )
525
527
if ( prompts . isCancel ( immediateResult ) ) return cancel ( )
526
528
immediate = immediateResult
527
529
}
528
530
}
529
531
530
- const pkgManager = pkgInfo ? pkgInfo . name : 'npm'
531
- let agent = 'npm'
532
- if ( immediate ) {
533
- const agentResult = await prompts . select ( {
534
- message : 'Select a package manager:' ,
535
- options : [
536
- { label : 'npm' , value : 'npm' } ,
537
- { label : 'yarn' , value : 'yarn' } ,
538
- { label : 'pnpm' , value : 'pnpm' } ,
539
- { label : 'bun' , value : 'bun' } ,
540
- ] ,
541
- initialValue : pkgManager ,
542
- } )
543
- if ( prompts . isCancel ( agentResult ) ) return cancel ( )
544
- agent = agentResult
545
- }
546
-
547
532
const root = path . join ( cwd , targetDir )
548
533
fs . mkdirSync ( root , { recursive : true } )
549
534
@@ -606,9 +591,8 @@ async function init() {
606
591
}
607
592
608
593
if ( immediate ) {
609
- if ( ! agent ) throw new Error ( )
610
- install ( root , agent )
611
- start ( root , agent )
594
+ install ( root , pkgManager )
595
+ start ( root , pkgManager )
612
596
} else {
613
597
let doneMessage = ''
614
598
const cdProjectName = path . relative ( cwd , root )
0 commit comments