File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -153,10 +153,8 @@ protected function handle(): int
153153
154154 \Leaf \FS \Directory::delete ("$ directory/app/views " );
155155 \Leaf \FS \Directory::delete ("$ directory/app/routes " );
156- \Leaf \FS \Directory::delete ("$ directory/public/index.php " );
157156
158157 \Leaf \FS \Directory::copy (__DIR__ . '/themes/api/routes ' , "$ directory/app/routes " );
159- \Leaf \FS \Directory::copy (__DIR__ . '/themes/api/index.php ' , "$ directory/public/index.php " );
160158
161159 \Leaf \FS \File::write ("$ directory/leaf " , function ($ content ) {
162160 return str_replace (
@@ -225,6 +223,16 @@ protected function handle(): int
225223 ]);
226224 }
227225
226+ if ($ this ->projectType !== 'basic ' ) {
227+ \Leaf \FS \File::write ("$ directory/.env " , function ($ content ) use ($ directory ) {
228+ return str_replace (
229+ ['LEAF_DB_NAME ' , 'LEAF_DB_USERNAME ' ],
230+ [basename ($ directory ), 'root ' ],
231+ $ content
232+ );
233+ });
234+ }
235+
228236 if (sprout ()->process (implode (' && ' , $ extraCommands ))->setTimeout (null )->run () === 0 || count ($ extraCommands ) === 1 ) {
229237 $ this ->writeln ("\n🚀 Application scaffolded successfully " );
230238 $ this ->writeln ('👉 Get started with the following commands: ' );
You can’t perform that action at this time.
0 commit comments