diff --git a/CHANGELOG.md b/CHANGELOG.md index c57856e..6752233 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [0.0.4] - 12 September 2024 +## [0.0.5] - 12 September 2024 ### Fixed - PHPStan fixes +## [0.0.4] - 8 May 2024 +### Fixed +- Add a command option to filter on file extension #3 @akosglue + ## [0.0.3] - 28 August 2023 ### Fixed - Remove old imports and unused `$finder` diff --git a/Console/Command/CheckOverrideCommand.php b/Console/Command/CheckOverrideCommand.php index 0723e5a..1ee53e5 100644 --- a/Console/Command/CheckOverrideCommand.php +++ b/Console/Command/CheckOverrideCommand.php @@ -51,6 +51,7 @@ protected function configure() { $this->setName('yireo:theme-overrides:check') ->setDescription('Check the overrides of a specified theme') + ->addOption('extension', '-e', InputOption::VALUE_OPTIONAL, 'Filter the checked files by extension (for example xml, phtml, ...)') ->addArgument('theme', InputOption::VALUE_REQUIRED, 'Theme name'); } @@ -100,6 +101,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int ]); $themeFiles = $this->finder->in($themePath)->files(); + + if($input->getOption('extension')) { + $themeFiles->name('*.' . $input->getOption('extension')); + } + foreach ($themeFiles as $themeFile) { $parentThemeFile = null; $lineDiff = 0;