From 9a0243049681af0be8193401d057c8eea055cb5d Mon Sep 17 00:00:00 2001 From: Max Kucherenko <> Date: Fri, 23 Aug 2019 16:44:34 +0300 Subject: [PATCH] Build script now fails if PHP doc is incorrect or contais errors --- build.sh | 11 +++++++++-- doc/config.php | 1 - 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 6d758de..daf1081 100755 --- a/build.sh +++ b/build.sh @@ -13,8 +13,15 @@ if ./vendor/bin/phpunit --testdox ./tests/; then rm -rf ./doc/generated mkdir ./doc/generated echo 'Generate Documentation' - php ./tools/sami.phar update ./doc/config.php - rm -rf ./cache + if php ./tools/sami.phar -v update ./doc/config.php; then + echo "$(tput setaf 2)Documentation Generated Successfully$(tput sgr 0)" + rm -rf ./cache + else + echo "$(tput setaf 1)Documentation Generation Failed$(tput sgr 0)" + rm -rf ./doc/generated + rm -rf ./cache + exit 1 + fi else exit 1 fi \ No newline at end of file diff --git a/doc/config.php b/doc/config.php index c917c60..9dbad9f 100644 --- a/doc/config.php +++ b/doc/config.php @@ -9,7 +9,6 @@ ->exclude('Proto') ->in('./lib'); -echo "@@@@ " . __DIR__.'/generated'; return new Sami($iterator, array( 'build_dir' => __DIR__.'/generated' )); \ No newline at end of file