Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to disable printing errors to standard output #100

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/Command/BuildDocsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ protected function configure()
InputOption::VALUE_NONE,
'Return a non-zero code if there are errors/warnings'
)
->addOption(
'print-errors',
null,
InputOption::VALUE_NONE,
'Print errors when to standard output'
)
;
}

Expand Down Expand Up @@ -137,7 +143,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
KernelFactory::createKernel($this->buildConfig, $this->urlChecker ?? null)
);

$this->addProgressListener($builder->getConfiguration()->getEventManager());
$configuration = $builder->getConfiguration();
$configuration->silentOnError(!$input->getOption('print-errors'));
$this->addProgressListener($configuration->getEventManager());

$builder->build(
$this->buildConfig->getContentDir(),
Expand Down