Skip to content

Commit 899b52e

Browse files
committed
feat: update console defaults for APIs
1 parent df0b9ad commit 899b52e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/CreateCommand.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ protected function handle(): int
158158

159159
\Leaf\FS\Directory::delete("$directory/public/index.php");
160160
\Leaf\FS\Directory::copy(__DIR__ . '/themes/api/index.php', "$directory/public/index.php");
161+
162+
\Leaf\FS\File::write("$directory/leaf", function ($content) {
163+
return str_replace(
164+
'Leaf\Core::loadConsole()',
165+
"Leaf\Core::mode('api');\nLeaf\Core::loadConsole()",
166+
$content
167+
);
168+
});
161169
}
162170

163171
$this->writeln("\n🚀 Successfully created project <info>" . basename($directory) . "</info>\n");

0 commit comments

Comments
 (0)