From f4dd3943bccaf14ebe783438e22af7b516166035 Mon Sep 17 00:00:00 2001 From: Dave Redfern Date: Wed, 2 Dec 2020 17:34:04 -0500 Subject: [PATCH] =?UTF-8?q?Fix=20to=20handle=20missing=20styles=20due=20to?= =?UTF-8?q?=20upstream=20=E2=80=9Cbc=E2=80=9D=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/console | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/bin/console b/bin/console index b59be94..061e588 100755 --- a/bin/console +++ b/bin/console @@ -20,6 +20,7 @@ if ((!$loader = includeIfExists(__DIR__.'/../vendor/autoload.php')) && (!$loader } use Symfony\Component\Console\Application; +use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Formatter\OutputFormatterStyle; use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\Console\Output\ConsoleOutput; @@ -31,14 +32,17 @@ if (file_exists($env)) { (new Dotenv())->loadEnv($env); } +$formatter = new OutputFormatter(false, [ + 'ok' => new OutputFormatterStyle('white', 'green', ['bold']), + 'err' => new OutputFormatterStyle('white', 'red', ['bold']), + 'step' => new OutputFormatterStyle('white', 'blue', ['bold']), + 'q' => new OutputFormatterStyle('white', 'cyan', ['bold']), + 'warn' => new OutputFormatterStyle('white', 'yellow', ['bold']), + 'i' => new OutputFormatterStyle('white', 'magenta', ['bold']), +]); + $input = new ArgvInput(); -$output = new ConsoleOutput(); -$output->getFormatter()->setStyle('ok', new OutputFormatterStyle('white', 'green', ['bold'])); -$output->getFormatter()->setStyle('err', new OutputFormatterStyle('white', 'red', ['bold'])); -$output->getFormatter()->setStyle('step', new OutputFormatterStyle('white', 'blue', ['bold'])); -$output->getFormatter()->setStyle('q', new OutputFormatterStyle('white', 'cyan', ['bold'])); -$output->getFormatter()->setStyle('warn', new OutputFormatterStyle('white', 'yellow', ['bold'])); -$output->getFormatter()->setStyle('i', new OutputFormatterStyle('white', 'magenta', ['bold'])); +$output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, null, $formatter); $app = new Application('Sync-It with Mutagen', '1.0.0'); $commands = [