From 36b879f97d7b187c87a94eb60af5b7d3b7253d56 Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Wed, 19 Aug 2020 13:36:41 +0100 Subject: [PATCH] fix: don't decorate output if --colors=never is set --- bin/pest | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/pest b/bin/pest index 6c704ca1..663d549f 100755 --- a/bin/pest +++ b/bin/pest @@ -6,6 +6,7 @@ use Pest\Actions\ValidatesEnvironment; use Pest\Console\Command; use Pest\Support\Container; use Pest\TestSuite; +use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\OutputInterface; @@ -27,7 +28,9 @@ use Symfony\Component\Console\Output\OutputInterface; $rootPath = getcwd(); $testSuite = TestSuite::getInstance($rootPath); - $output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, true); + + $isDecorated = (new ArgvInput())->getParameterOption('--colors', 'always') !== 'never'; + $output = new ConsoleOutput(ConsoleOutput::VERBOSITY_NORMAL, $isDecorated); $container = Container::getInstance(); $container->add(TestSuite::class, $testSuite);