mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
fix: dirty argument
This commit is contained in:
8
bin/pest
8
bin/pest
@ -16,6 +16,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||||||
$_SERVER['COLLISION_PRINTER'] = 'DefaultPrinter';
|
$_SERVER['COLLISION_PRINTER'] = 'DefaultPrinter';
|
||||||
|
|
||||||
$args = $_SERVER['argv'];
|
$args = $_SERVER['argv'];
|
||||||
|
$dirty = false;
|
||||||
|
|
||||||
foreach ($args as $key => $value) {
|
foreach ($args as $key => $value) {
|
||||||
if (str_contains($value, '--compact')) {
|
if (str_contains($value, '--compact')) {
|
||||||
@ -33,6 +34,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (str_contains($value, '--dirty')) {
|
if (str_contains($value, '--dirty')) {
|
||||||
|
$dirty = true;
|
||||||
unset($args[$key]);
|
unset($args[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,10 +68,8 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||||||
$argv->getParameterOption('--test-directory', (new ConfigLoader($rootPath))->getTestsDirectory()),
|
$argv->getParameterOption('--test-directory', (new ConfigLoader($rootPath))->getTestsDirectory()),
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($args as $key => $value) {
|
if ($dirty) {
|
||||||
if (str_contains($value, '--dirty')) {
|
$testSuite->tests->filter(new GitDirtyTestCaseFilter($rootPath));
|
||||||
$testSuite->tests->filter(new GitDirtyTestCaseFilter($rootPath));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$isDecorated = $argv->getParameterOption('--colors', 'always') !== 'never';
|
$isDecorated = $argv->getParameterOption('--colors', 'always') !== 'never';
|
||||||
|
|||||||
Reference in New Issue
Block a user