Make install command available only if Flarum is not installed

pull/21/head^2
Franz Liedke 2015-09-03 08:03:03 +02:00
parent 680e8b53d6
commit 6b4ee29202
1 changed files with 6 additions and 1 deletions

View File

@ -12,6 +12,7 @@
use Flarum\Console\GenerateExtensionCommand;
use Flarum\Console\UpgradeCommand;
use Flarum\Core;
use Flarum\Install\Console\InstallCommand;
use Symfony\Component\Console\Application;
@ -19,7 +20,11 @@ $app = require_once __DIR__.'/bootstrap.php';
$console = new Application('Flarum', $app::VERSION);
$console->add(new InstallCommand($app));
if (!Core::isInstalled()) {
$app->register(new \Flarum\Install\InstallServiceProvider($app));
$console->add(new InstallCommand($app));
}
$console->add(new UpgradeCommand($app));
$console->add(new GenerateExtensionCommand($app));