Set return code to non-zero when validate fails
parent
666ac623f4
commit
7caf61fc66
|
@ -46,18 +46,18 @@ EOT
|
||||||
|
|
||||||
if (!file_exists($file)) {
|
if (!file_exists($file)) {
|
||||||
$output->writeln('<error>'.$file.' not found.</error>');
|
$output->writeln('<error>'.$file.' not found.</error>');
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
if (!is_readable($file)) {
|
if (!is_readable($file)) {
|
||||||
$output->writeln('<error>'.$file.' is not readable.</error>');
|
$output->writeln('<error>'.$file.' is not readable.</error>');
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
JsonFile::parseJson(file_get_contents($file));
|
JsonFile::parseJson(file_get_contents($file));
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$output->writeln('<error>'.$e->getMessage().'</error>');
|
$output->writeln('<error>'.$e->getMessage().'</error>');
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$output->writeln('<info>'.$file.' is valid</info>');
|
$output->writeln('<info>'.$file.' is valid</info>');
|
||||||
|
|
Loading…
Reference in New Issue