-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move rockshell init in a dedicated file to support rockmigratio…
…ns rockshell api
- Loading branch information
1 parent
5f637e5
commit cca1fcb
Showing
2 changed files
with
23 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,3 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
use Symfony\Component\Console\Output\ConsoleOutput; | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
$app = new \RockShell\Application(); | ||
$app->registerCommands(); | ||
try { | ||
if (version_compare(phpversion(), '8.0', '<')) { | ||
throw new Exception( | ||
"PHP Version must be at least 8.0 - your version is " . phpversion() | ||
); | ||
} | ||
$app->run(); | ||
} catch (\Throwable $th) { | ||
$output = new ConsoleOutput(); | ||
$output->writeln("<bg=red;options=bold>" . $th->getMessage() . "</>"); | ||
} | ||
include __DIR__ . "/rock.php"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
use Symfony\Component\Console\Output\ConsoleOutput; | ||
|
||
/** | ||
* This is a separate file to keep DRY for RockMigrations rockshell() method | ||
*/ | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
$app = new \RockShell\Application(); | ||
$app->registerCommands(); | ||
try { | ||
if (version_compare(phpversion(), '8.0', '<')) { | ||
throw new Exception( | ||
"PHP Version must be at least 8.0 - your version is " . phpversion() | ||
); | ||
} | ||
$app->run(); | ||
} catch (\Throwable $th) { | ||
$output = new ConsoleOutput(); | ||
$output->writeln("<bg=red;options=bold>" . $th->getMessage() . "</>"); | ||
} |