From 217fae09673a5a24631121b609fd399ee9e7cdcd Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 11 Jan 2023 20:17:51 +0000 Subject: [PATCH] fix: dirty argument --- bin/pest | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/pest b/bin/pest index b3a522e2..188b5bb8 100755 --- a/bin/pest +++ b/bin/pest @@ -16,6 +16,7 @@ use Symfony\Component\Console\Output\OutputInterface; $_SERVER['COLLISION_PRINTER'] = 'DefaultPrinter'; $args = $_SERVER['argv']; + $dirty = false; foreach ($args as $key => $value) { if (str_contains($value, '--compact')) { @@ -33,6 +34,7 @@ use Symfony\Component\Console\Output\OutputInterface; } if (str_contains($value, '--dirty')) { + $dirty = true; unset($args[$key]); } @@ -66,10 +68,8 @@ use Symfony\Component\Console\Output\OutputInterface; $argv->getParameterOption('--test-directory', (new ConfigLoader($rootPath))->getTestsDirectory()), ); - foreach ($args as $key => $value) { - if (str_contains($value, '--dirty')) { - $testSuite->tests->filter(new GitDirtyTestCaseFilter($rootPath)); - } + if ($dirty) { + $testSuite->tests->filter(new GitDirtyTestCaseFilter($rootPath)); } $isDecorated = $argv->getParameterOption('--colors', 'always') !== 'never';