Browse Source

download MultiCraft default game during build

master
poikilos 5 years ago
committed by Jacob Gustafson
parent
commit
a0f0ac8134
  1. 57
      build-MultiCraft.sh

57
build-MultiCraft.sh

@ -5,6 +5,13 @@
# cmake . -DOpenGL_GL_PREFERENCE=GLVND && make # cmake . -DOpenGL_GL_PREFERENCE=GLVND && make
me="$0" me="$0"
OFFLINE=false
if [ "@$1" = "@--offline" ]; then
OFFLINE=true
fi
if [ "@$2" = "@--offline" ]; then
OFFLINE=true
fi
customDie() { customDie() {
echo echo
echo echo
@ -13,19 +20,36 @@ customDie() {
echo echo
exit 1 exit 1
} }
if [ ! -d "$HOME/Downloads/git/MultiCraft" ]; then dieIfOnline() {
mkdir -p "$HOME/Downloads/git/MultiCraft" echo
echo
if [ "@$OFFLINE" = "@false" ]; then
echo "$me ERROR:"
echo $1
echo
exit 1
else
echo "$me WARNING:"
echo $1
echo
fi
}
GIT_USER_DIR="$HOME/Downloads/git/MultiCraft"
if [ ! -d "$GIT_USER_DIR" ]; then
mkdir -p "$GIT_USER_DIR"
fi fi
cd $HOME/Downloads/git/MultiCraft || customDie "cd $HOME/Downloads/git/MultiCraft FAILED" cd $GIT_USER_DIR || customDie "cd $GIT_USER_DIR FAILED"
goodFlagFile=MultiCraft/CMakeLists.txt goodFlagFile=MultiCraft/CMakeLists.txt
if [ -f "`which git`" ]; then if [ -f "`which git`" ]; then
echo "In `pwd`..." echo "In `pwd`..."
if [ ! -d MultiCraft ]; then if [ ! -d MultiCraft ]; then
if [ "@$OFFLINE" = "@false" ]; then
git clone https://github.com/MultiCraft/MultiCraft.git || customDie "Cannot clone MultiCraft from `pwd`" git clone https://github.com/MultiCraft/MultiCraft.git || customDie "Cannot clone MultiCraft from `pwd`"
fi
cd MultiCraft || customDie "Cannot cd MultiCraft from `pwd`" cd MultiCraft || customDie "Cannot cd MultiCraft from `pwd`"
else else
cd MultiCraft || customDie "Cannot cd MultiCraft from `pwd`" cd MultiCraft || customDie "Cannot cd MultiCraft from `pwd`"
git pull || echo "WARNING: Cannot pull MultiCraft from `pwd`" git pull || dieIfOnline "WARNING: Cannot pull MultiCraft from `pwd`"
fi fi
else else
if [ ! -f "$goodFlagFile" ]; then if [ ! -f "$goodFlagFile" ]; then
@ -34,6 +58,28 @@ else
cd MultiCraft || customDie "Cannot cd MultiCraft from `pwd`" cd MultiCraft || customDie "Cannot cd MultiCraft from `pwd`"
fi fi
fi fi
cd games || customDie "cd games FAILED in `pwd`"
rmdir default
if [ ! -d "default" ]; then
if [ "@$OFFLINE" = "@false" ]; then
git clone https://github.com/MultiCraft/MultiCraft_game default || customDie "Cannot "
else
echo
echo
echo
echo "ERROR: default is not in `pwd`--worlds cannot load without a game."
echo
echo
sleep 2
fi
else
if [ "@$OFFLINE" = "@false" ]; then
cd default || customDie "cd default FAILED in `pwd`"
git pull || customDie "git pull FAILED in `pwd`"
cd .. || customDie "cd .. FAILED in `pwd`"
fi
fi
cd .. || customDie "cd .. FAILED in `pwd`"
srcPath=. srcPath=.
flag1="-DOpenGL_GL_PREFERENCE=GLVND" flag1="-DOpenGL_GL_PREFERENCE=GLVND"
echo echo
@ -47,4 +93,7 @@ if [ -f "`pwd`/bin/MultiCraft" ]; then
else else
echo "`pwd`" echo "`pwd`"
fi fi
if [ -d "$GIT_USER_DIR/MultiCraft-poikilos" ]; then
rsync -rt --info=progress2 --exclude 'multicraft.conf' "$GIT_USER_DIR/MultiCraft/" "$GIT_USER_DIR/MultiCraft-poikilos"
fi
echo "Done." echo "Done."

Loading…
Cancel
Save