]> BookStack Code Mirror - system-cli/blobdiff - run.php
Made changes based upon freebsd/openbsd testing
[system-cli] / run.php
diff --git a/run.php b/run.php
index 4d503fede26407a544079bd31511fa57488d98ec..10ee64b337f262d142ddcb13f58c4c53d4057c2e 100644 (file)
--- a/run.php
+++ b/run.php
@@ -10,10 +10,20 @@ require __DIR__ . '/vendor/autoload.php';
 use Symfony\Component\Console\Formatter\OutputFormatterStyle;
 use Symfony\Component\Console\Output\ConsoleOutput;
 
+// Get the app with commands loaded
 $app = require __DIR__ . '/src/app.php';
 
+// Configure output formatting
+$output =  new ConsoleOutput();
+$formatter = $output->getFormatter();
+$formatter->setStyle('warn', new OutputFormatterStyle('yellow'));
+$formatter->setStyle('info', new OutputFormatterStyle('blue'));
+$formatter->setStyle('success', new OutputFormatterStyle('green'));
+$formatter->setStyle('error', new OutputFormatterStyle('red'));
+
+// Run the command and handle errors
 try {
-    $app->run();
+    $app->run(null, $output);
 } catch (Exception $error) {
     $output = (new ConsoleOutput())->getErrorOutput();
     $output->getFormatter()->setStyle('error', new OutputFormatterStyle('red'));