Created
December 23, 2016 14:11
-
-
Save mpchadwick/2b161f82264962425f43b29c3681eeaf to your computer and use it in GitHub Desktop.
pre-commit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
$projectName = basename(getcwd()); | |
exec('vendor/bin/phpunit', $output, $returnCode); | |
if ($returnCode !== 0) { | |
$minimalTestSummary = array_pop($output); | |
printf("Test suite for %s failed: ", $projectName); | |
printf("( %s ) %s%2\$s", $minimalTestSummary, PHP_EOL); | |
printf("ABORTING COMMIT!\n"); | |
exit(1); | |
} | |
exit(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment