Created
April 2, 2015 15:32
-
-
Save bacher09/c1969df6ca2657496b71 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 | |
XONOTIC_LINUX=xonotic-glx | |
XONOTIC_OSX="open $HOME/Downloads/Xonotic/Xonotic.app -W --args" | |
XONOTIC_DATA_LINUX=$HOME/.xonotic/data | |
XONOTIC_DATA_OSX="$HOME/Library/Application Support/xonotic/data" | |
realpath() { | |
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" | |
} | |
case $(uname -s) in | |
Darwin) | |
RUN_XONOTIC=$XONOTIC_OSX | |
AUTODEMO=$XONOTIC_DATA_OSX/autodemo_folder | |
;; | |
*) | |
RUN_XONOTIC=$XONOTIC_LINUX | |
AUTODEMO=$XONOTIC_DATA_LINUX/autodemo_folder | |
;; | |
esac | |
DEMO_FIlE=$(realpath $1) | |
if [ ! -f $DEMO_FIlE ]; then | |
echo "Bad file" | |
exit 1 | |
fi | |
mkdir -p "$AUTODEMO" | |
ln -sf "$DEMO_FIlE" "$AUTODEMO/demo.dem" | |
$RUN_XONOTIC +playdemo autodemo_folder/demo.dem | |
rm -f "$AUTODEMO/demo.dem" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment