Skip to content

Commit 0e2f7e8

Browse files
committed
fix: patch up infinite update loop
1 parent f27bd38 commit 0e2f7e8

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

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": "v2.15",
5+
"version": "v2.15.1",
66
"keywords": [
77
"leaf",
88
"php",

src/CreateCommand.php

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,28 +67,29 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6767
{
6868
$leaf = Utils\Core::findLeaf();
6969
$composer = Utils\Core::findComposer();
70-
$needsUpdate = Package::updateAvailable();
70+
// $needsUpdate = Package::updateAvailable();
7171

72-
if ($needsUpdate) {
73-
$output->writeln('<comment>Update found, updating to the latest stable version...</comment>');
74-
$updateProcess = Process::fromShellCommandline('php ' . dirname(__DIR__) . '/bin/leaf update');
72+
$output->writeln('<comment>v4.0 Beta has been released. Run composer global require leafs/cli:v4.0-beta -W to try it out</comment>');
7573

76-
$updateProcess->run();
74+
// if ($needsUpdate) {
75+
// // $updateProcess = Process::fromShellCommandline('php ' . dirname(__DIR__) . '/bin/leaf update');
7776

78-
if ($updateProcess->isSuccessful()) {
79-
$output->writeln("<info>Leaf CLI updated successfully, building your app...</info>\n");
77+
// // $updateProcess->run();
8078

81-
$createProcess = Process::fromShellCommandline('php ' . implode(' ', $_SERVER['argv']));
82-
$createProcess->run(function ($type, $line) use ($output) {
83-
$output->write($line);
84-
});
79+
// // if ($updateProcess->isSuccessful()) {
80+
// // $output->writeln("<info>Leaf CLI updated successfully, building your app...</info>\n");
8581

86-
return 0;
87-
} else {
88-
$output->writeln("<error>❌ Leaf CLI update failed, please try again later</error>\n");
89-
$output->writeln("⚙️ Creating app with current version...\n");
90-
}
91-
}
82+
// // $createProcess = Process::fromShellCommandline('php ' . implode(' ', $_SERVER['argv']));
83+
// // $createProcess->run(function ($type, $line) use ($output) {
84+
// // $output->write($line);
85+
// // });
86+
87+
// // return 0;
88+
// // } else {
89+
// // $output->writeln("<error>❌ Leaf CLI update failed, please try again later</error>\n");
90+
// // $output->writeln("⚙️ Creating app with current version...\n");
91+
// // }
92+
// }
9293

9394
$name = $this->getAppName($input, $output);
9495
$directory = $name !== '.' ? getcwd() . '/' . $name : getcwd();

0 commit comments

Comments
 (0)