Skip to content

Commit

Permalink
readme.php: exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
jm42 committed Feb 21, 2019
1 parent 62c371f commit f1b2368
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion readme.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function main(string $filename) {
$tests = iterator_to_array(parse(file_get_contents($filename), 'php'));
$init = array_shift($tests);
$exec = runtime($init);
$ret = 0;

foreach ($tests as $id => $test) {
try {
Expand All @@ -42,8 +43,11 @@ function main(string $filename) {
}
} catch (RuntimeException $ex) {
fwrite(STDERR, "🔴 $id\n{$ex}\n\n");
$ret = 1;
}
}

return $ret;
}

main($argv[1] ?? 'README.md');
exit(main($argv[1] ?? 'README.md'));

0 comments on commit f1b2368

Please sign in to comment.