Skip to content

Commit

Permalink
Merge pull request #173 from arlina-espinoza/137-redirect-output-to-file
Browse files Browse the repository at this point in the history
#137 - Allow redirect output to a file.
  • Loading branch information
mglaman authored May 13, 2020
2 parents 13e7895 + 543967c commit eaee2c8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Command/CheckCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$command = array_merge($command, $paths);

$process = new Process($command);
$process->setTty(Tty::isTtySupported());
$process->setTimeout(null);
$process->run(static function ($type, $buffer) use ($output) {
if (Process::ERR === $type) {
$output->write($buffer, false, OutputInterface::OUTPUT_RAW);
$output->getErrorOutput()->write($buffer, false, OutputInterface::OUTPUT_RAW);
} else {
$output->writeln($buffer, OutputInterface::OUTPUT_RAW);
$output->write($buffer, false, OutputInterface::OUTPUT_RAW);
}
});
unlink($configuration);
Expand Down

0 comments on commit eaee2c8

Please sign in to comment.