Skip to content

Commit 3c31a4c

Browse files
committed
feat: after creating a console program, keep the bin set correctly
1 parent 629eeb5 commit 3c31a4c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/CreateCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ protected function handle(): int
152152
if ($this->projectType === 'console') {
153153
\Leaf\FS\File::move("$directory/bin/sprout", "$directory/bin/" . basename($directory));
154154

155+
\Leaf\FS\File::write("$directory/composer.json", function ($content) use ($directory) {
156+
return str_replace('"bin/sprout"', '"bin/' . basename($directory) . '"', $content);
157+
});
158+
155159
$this->writeln("\n🚀 Successfully created project " . basename($directory) . "\n");
156160
$this->writeln('👉 Get started with the following commands:');
157161
$this->writeln("\n cd " . basename($directory));

0 commit comments

Comments
 (0)