Skip to content

Commit 508d06a

Browse files
committed
feat: sync Leaf CLI to mvc console
1 parent a488999 commit 508d06a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

bin/leaf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,14 @@ $app->register(Leaf\Console\ViewBuildCommand::class);
3232
$app->register(Leaf\Console\ViewInstallCommand::class);
3333
$app->register(Leaf\Console\DeployCommand::class);
3434

35+
$app->on('command.notFound', function ($event) use ($app) {
36+
$command = $event->getCommandName();
37+
38+
if (\Leaf\FS\File::exists(getcwd() . "/leaf")) {
39+
$exitCode = (int) sprout()->run("php leaf $command", null);
40+
$event->setExitCode($exitCode);
41+
$event->stopPropagation();
42+
}
43+
});
44+
3545
$app->run();

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "leafs/cli",
33
"description": "A simple command line tool for installing and interacting with your leaf apps",
44
"homepage": "https://cli.leafphp.dev",
5-
"version": "v4.5.2",
5+
"version": "v4.6.0",
66
"keywords": [
77
"leaf",
88
"php",

0 commit comments

Comments
 (0)