Skip to content

Instantly share code, notes, and snippets.

@ZeldaZach
Last active August 29, 2015 14:27
Show Gist options
  • Select an option

  • Save ZeldaZach/12411ac5ebde4d7b1f06 to your computer and use it in GitHub Desktop.

Select an option

Save ZeldaZach/12411ac5ebde4d7b1f06 to your computer and use it in GitHub Desktop.
#!/bin/bash
#This is used to update main version of Cockatrice
set -e
log_date=$(date "+%b_%d_%Y_%H.%M.%S")
openOracle=0
while getopts ":o" opt; do
case $opt in
o) openOracle=1;;
esac
done
cd ~/Desktop/Stuff/Cockatrice/Cockatrice
git checkout master
git fetch upstream
git reset --hard upstream/master
mkdir -p build
cd build
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
make -j8
make install -j8
if [[ "$(pidof cockatrice)" ]]; then
killAll cockatrice
fi
if [[ "$(pidof oracle)" ]]; then
killAll oracle
fi
rm -rf /Applications/Cockatrice.app
rm -rf /Applications/More\ Apps/Oracle.app
mv release/cockatrice.app /Applications
mv release/oracle.app /Applications/More\ Apps
/Applications/cockatrice.app/Contents/MacOS/cockatrice &> ~/Desktop/Stuff/cockatrice/logs/Cockatrice_${log_date}_update.log &
if (( openOracle )); then
/Applications/More\ Apps/oracle.app/Contents/MacOS/oracle &> ~/Desktop/Stuff/cockatrice/logs/Oracle_${log_date}_update.log &
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment