Skip to content

Commit

Permalink
fix(importer): return int 0 at end of script and in case of empty dat…
Browse files Browse the repository at this point in the history
…aSources config
mrflos committed Jun 27, 2024
1 parent 3eed6b7 commit 11e0068
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions commands/ImporterCommand.php
Original file line number Diff line number Diff line change
@@ -71,7 +71,6 @@ protected function execute(InputInterface $input, OutputInterface $output)

$source = $input->getOption('source');
$hasWipe = $input->getOption('wipe');
$out = [];
if (!$source) {
$output->writeln("Importing all sources");
foreach ($this->wiki->config['dataSources'] as $source => $sourceOptions) {
@@ -81,19 +80,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
continue;
}
$output->writeln("Importing source \"{$source}\"");
//$out[$source] = $this->importer->syncSource($source, $sourceOptions);
$output->writeln($this->importer->syncSource($source, $sourceOptions));
}
return Command::SUCCESS;
} else {
if (empty($this->wiki->config['dataSources'][$source])) {
$output->writeln("No data source with key \"{$source}\" found in config, does dataSources[\"{$source}\"] contain something?");
return Command::INVALID;
return Command::SUCCESS;
}
$output->writeln("Importing source \"{$source}\"");
$res = $this->importer->syncSource($source, $this->wiki->config['dataSources'][$source]);
$output->writeln($res[1]);
return $res[0];
$output->writeln($res);
return Command::SUCCESS;
}
}
}

0 comments on commit 11e0068

Please sign in to comment.