@@ -91,6 +91,7 @@ protected function handle(): int
9191 ['title ' => 'Basic Leaf app ' , 'value ' => 'basic ' ],
9292 ['title ' => 'Full-stack MVC app ' , 'value ' => 'mvc ' ],
9393 ['title ' => 'Leaf MVC API app ' , 'value ' => 'api ' ],
94+ ['title ' => 'Console app ' , 'value ' => 'console ' ],
9495 ],
9596 ],
9697 ]);
@@ -124,6 +125,9 @@ protected function handle(): int
124125
125126 $ commands [] = "cd \"$ directory \"" ;
126127 $ commands [] = 'composer install --ansi ' ;
128+ } else if ($ this ->projectType === 'console ' ) {
129+ $ commands [] = "composer create-project leafs/sprout-app \"$ directory \" --ansi " ;
130+ $ commands [] = "cd \"$ directory \"" ;
127131 } else {
128132 $ commands [] = "composer create-project leafs/mvc \"$ directory \" --ansi " ;
129133 $ commands [] = "cd \"$ directory \"" ;
@@ -142,6 +146,19 @@ protected function handle(): int
142146 }
143147
144148 if (sprout ()->process (implode (' && ' , $ commands ))->setTimeout (null )->run () === 0 ) {
149+ if ($ this ->projectType === 'console ' ) {
150+ \Leaf \FS \File::move ("$ directory/bin/sprout " , "$ directory/bin/ " . basename ($ directory ));
151+
152+ $ this ->writeln ("\n🚀 Successfully created project " . basename ($ directory ) . "\n" );
153+ $ this ->writeln ('👉 Get started with the following commands: ' );
154+ $ this ->writeln ("\n cd " . basename ($ directory ));
155+ $ this ->writeln (" php ./bin/ " . basename ($ directory ));
156+
157+ $ this ->writeln ("\n🍁 Happy gardening! \n" );
158+
159+ return 0 ;
160+ }
161+
145162 if ($ this ->projectType === 'api ' ) {
146163 if (\Leaf \FS \File::exists ("$ directory/vite.config.js " )) {
147164 \Leaf \FS \File::delete ("$ directory/vite.config.js " );
0 commit comments