Skip to content

Commit c1fdef3

Browse files
committed
fix: handle case when no documents are found in configuration
1 parent 1badc2a commit c1fdef3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Console/GenerateCommand.php

+5
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ public function __invoke(Container $container, DirectoriesInterface $dirs): int
9898
$renderer->renderImports($imports);
9999
}
100100

101+
if ($config->getDocuments() === null || $config->getDocuments() === []) {
102+
$this->output->writeln('No documents found in configuration.');
103+
return Command::SUCCESS;
104+
}
105+
101106
foreach ($config->getDocuments() as $document) {
102107
$this->logger->info(\sprintf('Compiling %s...', $document->description));
103108

0 commit comments

Comments
 (0)