Skip to content

Commit

Permalink
feat: add source option for indexer cli
Browse files Browse the repository at this point in the history
  • Loading branch information
sitepark-veltrup committed Apr 2, 2024
1 parent 080645c commit c3fff86
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Console/Command/Indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ protected function configure(): void
InputArgument::OPTIONAL | InputArgument::IS_ARRAY,
'Resources paths or directories of resources to be indexed.'
)
->addOption(
'source',
null,
InputArgument::OPTIONAL,
'Uses only the indexer of a specific source',
''
)
;
}

Expand All @@ -53,12 +60,15 @@ protected function execute(
$this->output = $output;
$this->io = new SymfonyStyle($input, $output);

$paths = $typedInput->getArrayArgument('paths');
$source = $typedInput->getStringOption('source');

$resourceChannel = $this->channelFactory->create();
$this->io->title('Channel: ' . $resourceChannel->name);

foreach ($this->indexers->getIndexers() as $indexer) {
if (!empty($source) && $indexer->getSource() !== $source) {
continue;
}
if ($indexer->enabled()) {
$this->io->newLine();
$this->io->section(
Expand Down

0 comments on commit c3fff86

Please sign in to comment.