@@ -78,13 +78,13 @@ const options = [
7878] ;
7979
8080// Formulate Questions if `create` args are missing
81- function requestParams ( argv , templates ) {
81+ function requestParams ( repo , dest , argv , templates ) {
8282 const cwd = resolve ( argv . cwd ) ;
8383
8484 return [
8585 // Required data
8686 {
87- type : argv . template ? null : 'select' ,
87+ type : repo ? null : 'select' ,
8888 name : 'template' ,
8989 message : 'Pick a template' ,
9090 choices : templates ,
@@ -96,12 +96,12 @@ function requestParams(argv, templates) {
9696 message : 'Remote template to clone (user/repo#tag)' ,
9797 } ,
9898 {
99- type : argv . dest ? null : 'text' ,
99+ type : dest ? null : 'text' ,
100100 name : 'dest' ,
101101 message : 'Directory to create the app' ,
102102 } ,
103103 {
104- type : prev => ( ! dirExists ( cwd , prev || argv . dest ) ? null : 'confirm' ) ,
104+ type : prev => ( ! dirExists ( cwd , prev || dest ) ? null : 'confirm' ) ,
105105 name : 'force' ,
106106 message : 'The destination directory exists. Overwrite?' ,
107107 initial : false ,
@@ -211,7 +211,7 @@ async function command(repo, dest, argv) {
211211 // Prompt if incomplete data
212212 if ( ! repo || ! dest ) {
213213 const templates = await fetchTemplates ( ) ;
214- const questions = requestParams ( argv , templates ) ;
214+ const questions = requestParams ( repo , dest , argv , templates ) ;
215215 const onCancel = ( ) => {
216216 info ( 'Aborting execution' ) ;
217217 process . exit ( ) ;
0 commit comments