Created
July 14, 2015 21:24
-
-
Save ZeldaZach/8f3e482f4488cc5bedee to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/bin/bash | |
| #This is used to test PRs | |
| set -e | |
| cd ~/Desktop/Stuff/cockatrice | |
| debug=0 | |
| server=0 | |
| openOracle=0 | |
| while getopts ":u: :d :s :o" opt; do | |
| case $opt in | |
| u) cd "./$OPTARG";; | |
| d) debug=1;; | |
| s) server=1;; | |
| o) openOracle=1;; | |
| :) echo "Error: $OPTARG"; exit;; | |
| esac | |
| done | |
| if [[ $* != *-u* ]] | |
| then echo "WARNING: -u must be set with a GitHub folder"; exit | |
| fi | |
| git pull || true | |
| git status | |
| mkdir -p build | |
| cd build | |
| if [ $server -eq 1 ]; then | |
| cmake .. -DWITH_SERVER=1 -DWITH_CLIENT=1 -DWITH_ORACLE=1 -DWITH_QT4=0 -DCMAKE_BUILD_TYPE=Debug -DUPDATE_TRANSLATIONS=0 -DCMAKE_PREFIX_PATH=$QT5_DIR | |
| else | |
| cmake .. -DWITH_SERVER=0 -DWITH_CLIENT=1 -DWITH_ORACLE=1 -DWITH_QT4=0 -DCMAKE_BUILD_TYPE=Debug -DUPDATE_TRANSLATIONS=0 -DCMAKE_PREFIX_PATH=$QT5_DIR | |
| fi | |
| make -j5 | |
| make install -j5 | |
| if [ "$(pidof cockatrice)" ] | |
| then killAll cockatrice | |
| fi | |
| if [ "$(pidof servatrice)" ] | |
| then killAll servatrice | |
| fi | |
| release/cockatrice.app/Contents/MacOS/cockatrice &> ~/Desktop/Stuff/cockatrice/logs/Cockatrice_`date "+%b_%d_%Y_%H.%M.%S"`_test.log & | |
| if [ $debug -eq 1 ] | |
| then open ~/Desktop/Stuff/cockatrice/logs/Cockatrice_`date "+%b_%d_%Y_%H.%M.%S"`_test.log | |
| fi | |
| if [ $server -eq 1 ] | |
| then release/servatrice.app/Contents/MacOS/servatrice --config ~/Desktop/Stuff/cockatrice/servatrice.ini &> ~/Desktop/Stuff/cockatrice/logs/Servatrice_`date "+%b_%d_%Y_%H.%M.%S"`_test.log & | |
| if [[ $debug -eq 1 ]] | |
| then open ~/Desktop/Stuff/cockatrice/logs/Servatrice_`date "+%b_%d_%Y_%H.%M.%S"`_test.log | |
| fi | |
| fi | |
| if [ $openOracle -eq 1 ] | |
| then | |
| release/oracle.app/Contents/MacOS/oracle &> ~/Desktop/Stuff/cockatrice/logs/Oracle_`date "+%b_%d_%Y_%H.%M.%S"`_test.log & | |
| open ~/Desktop/Stuff/cockatrice/logs/Oracle_`date "+%b_%d_%Y_%H.%M.%S"`_test.log | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment