@@ -41,25 +41,22 @@ export async function runCreate(
4141 type : 'input' ,
4242 name : 'projectDirectory' ,
4343 message : 'Please provide the directory where you want to create the project?' ,
44- default : 'my-app' ,
44+ default : path . resolve ( 'my-app' ) ,
4545 } ,
4646 ] ) ;
4747 projectDirectory = projectDirAnswer . projectDirectory ;
4848 }
4949
50+ const projectPath = path . resolve ( projectDirectory ?. trim ( ) || 'my-app' ) ;
51+
5052 // If template name is not provided, show available templates and let user select
5153 if ( ! templateName ) {
52- console . log ( '\n📋 Available templates:\n' ) ;
53- templatesToUse . forEach ( t => {
54- console . log ( ` ${ t . name . padEnd ( 12 ) } - ${ t . description } ` ) ;
55- } ) ;
56- console . log ( '' ) ;
57-
54+
5855 const templateQuestion = [
5956 {
6057 type : 'list' ,
6158 name : 'templateName' ,
62- message : 'Select a template:' ,
59+ message : 'Select a project template that will be used to create your project :' ,
6360 choices : templatesToUse . map ( t => ( {
6461 name : `${ t . name } - ${ t . description } ` ,
6562 value : t . name ,
@@ -85,9 +82,6 @@ export async function runCreate(
8582
8683 const templateRepoUrl = options ?. ssh && template . repoSSH ? template . repoSSH : template . repo ;
8784
88- // Define the full path for the new project (projectDirectory is set above via arg or prompt)
89- const dir = projectDirectory ?? 'my-app' ;
90- const projectPath = path . resolve ( dir ) ;
9185 console . log ( `Cloning template "${ templateName } " from ${ templateRepoUrl } into ${ projectPath } ...` ) ;
9286
9387 try {
@@ -165,7 +159,7 @@ export async function runCreate(
165159 // Let the user know the project was created successfully
166160 console . log ( '\n✨ Project created successfully! ✨\n' ) ;
167161 console . log ( `To get started:` ) ;
168- console . log ( ` cd ${ dir } ` ) ;
162+ console . log ( ` cd ${ projectPath } ` ) ;
169163 console . log ( ' Happy coding! 🚀' ) ;
170164 } catch ( error ) {
171165 console . error ( '❌ An error occurred:' ) ;
0 commit comments