Skip to content

Commit

Permalink
Created script to aggregate return status
Browse files Browse the repository at this point in the history
- See travis-ci/travis-build#67
- Aggregates return status for each command, and exits with non-zero status if
  any single command has a non-zero status
  • Loading branch information
weierophinney committed Feb 1, 2013
1 parent 937098e commit b6d34e3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ before_install:
- wget http://cs.sensiolabs.org/get/php-cs-fixer.phar

script:
- php ./tests/run-tests.php
- output=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 library); if [[ $output ]]; then while read -r line; do echo -e "\e[00;31m$line\e[00m"; done <<< "$output"; false; fi;
- output=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 tests); if [[ $output ]]; then while read -r line; do echo -e "\e[00;31m$line\e[00m"; done <<< "$output"; false; fi;
- output=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 bin); if [[ $output ]]; then while read -r line; do echo -e "\e[00;31m$line\e[00m"; done <<< "$output"; false; fi;
- ./bin/travis-build.sh

notifications:
irc: "irc.freenode.org#zftalk.dev"
Expand Down
22 changes: 22 additions & 0 deletions bin/travis-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
cd "$(dirname $(dirname "$0"))"
php ./tests/run-tests.php
testresults=$?
cslibrary=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 library); if [[ $cslibrary ]];then while read -r line;do echo -e "\e[00;31m$line\e[00m"; done <<< "$cslibrary"; false; fi;
cstests=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 tests); if [[ $cstests ]]; then while read -r line; do echo -e "\e[00;31m$line\e[00m"; done <<< "$cstests"; false; fi;
csbin=$(php php-cs-fixer.phar fix -v --dry-run --level=psr2 bin); if [[ $csbin ]]; then while read -r line; do echo -e "\e[00;31m$line\e[00m"; done <<< "$csbin"; false; fi;

if [[ "$testresults" ]]; then
exit 1 ;
fi
if [[ "$cslibrary" ]]; then
exit 1 ;
fi
if [[ "$cstests" ]]; then
exit 1 ;
fi
if [[ "$csbin" ]]; then
exit 1 ;
fi

exit 0

0 comments on commit b6d34e3

Please sign in to comment.