Fix output for tests to pass again

This commit is contained in:
Oliver Davies 2018-01-15 09:24:38 +00:00
parent 6d6f5596ce
commit b9b41aa437
3 changed files with 37 additions and 9 deletions

View file

@ -8,6 +8,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Filesystem\Exception\IOException;
class GenerateCommand extends Command
{
@ -44,10 +45,14 @@ class GenerateCommand extends Command
throw new \Exception('No filters.php file found.');
}
// TOOD: Check return code.
new Builder($filters, $outputFile);
$io = new SymfonyStyle($input, $output);
$io->success(sprintf('%s file generated.', $outputFile));
try {
new Builder($filters, $outputFile);
$io->success(sprintf('%s file generated.', $outputFile));
} catch (IOException $e) {
$io->error($e->getMessage());
}
}
}