@@ -8,7 +8,6 @@ const argv = require('minimist')(process.argv.slice(2))
88const prompts = require ( 'prompts' )
99const execa = require ( 'execa' )
1010const { cyan, blue, yellow, bold, dim, green } = require ( 'kolorist' )
11- const { parseNi, run } = require ( '@antfu/ni' )
1211const { version } = require ( './package.json' )
1312
1413const cwd = process . cwd ( )
@@ -108,9 +107,18 @@ async function init() {
108107 } )
109108
110109 if ( yes ) {
111- await run ( parseNi , [ '-C' , related ] )
112- // await execa(pkgManager, ['-C', related, 'install'], { stdio: 'inherit' })
113- await execa ( pkgManager , [ '-C' , related , 'run' , 'dev' ] , { stdio : 'inherit' } )
110+ const { agent } = await prompts ( {
111+ name : 'agent' ,
112+ type : 'select' ,
113+ message : 'Choose the agent' ,
114+ choices : [ 'npm' , 'yarn' , 'pnpm' ] . map ( i => ( { value : i , title : i } ) ) ,
115+ } )
116+
117+ if ( ! agent )
118+ return
119+
120+ await execa ( agent , [ 'install' ] , { stdio : 'inherit' , cwd : root } )
121+ await execa ( agent , [ 'run' , 'dev' ] , { stdio : 'inherit' , cwd : root } )
114122 }
115123 else {
116124 console . log ( dim ( '\n start it later by:\n' ) )
0 commit comments