travis: Always clear DF folder

develop
lethosor 2018-12-30 17:47:10 -05:00
parent af0d569afd
commit b08ccd001e
2 changed files with 18 additions and 15 deletions

@ -28,7 +28,7 @@ matrix:
- g++-4.8
before_install:
- export DF_VERSION=$(sh travis/get-df-version.sh)
- export DF_FOLDER="$HOME/DF-travis/$DF_VERSION"
- export DF_FOLDER="$HOME/DF-travis/$DF_VERSION/df_linux"
- pip install --user "sphinx==1.4" "requests[security]"
- sh travis/build-lua.sh
- sh travis/download-df.sh
@ -56,9 +56,7 @@ script:
- python travis/check-rpc.py "$DF_FOLDER/dfhack-rpc.txt"
before_cache:
- cat "$DF_FOLDER/stderr.log"
- rm -rf "$DF_FOLDER/hack"
- rm -rf "$DF_FOLDER/dfhack-config"
- rm -f "$DF_FOLDER"/*.log
- rm -rf "$DF_FOLDER"
notifications:
email: false
irc:

@ -15,26 +15,31 @@ cd "$DF_FOLDER"
if [ -f receipt ]; then
if [ "$selfmd5" != "$(cat receipt)" ]; then
echo "download-df.sh changed; removing DF"
rm receipt
else
echo "Already downloaded $DF_VERSION"
exit 0
fi
fi
rm -rif "$tardest" df_linux
if [ ! -f receipt ]; then
rm -f "$tardest"
minor=$(echo "$DF_VERSION" | cut -d. -f2)
patch=$(echo "$DF_VERSION" | cut -d. -f3)
url="http://www.bay12games.com/dwarves/df_${minor}_${patch}_linux.tar.bz2"
echo Downloading
wget "$url" -O "$tardest"
fi
minor=$(echo "$DF_VERSION" | cut -d. -f2)
patch=$(echo "$DF_VERSION" | cut -d. -f3)
url="http://www.bay12games.com/dwarves/df_${minor}_${patch}_linux.tar.bz2"
rm -rf df_linux
mkdir df_linux
echo Downloading
wget "$url" -O "$tardest"
echo Extracting
tar xf "$tardest" --strip-components=1
tar xf "$tardest" --strip-components=1 -C df_linux
echo Changing settings
echo '' >> "$DF_FOLDER/data/init/init.txt"
echo '[PRINT_MODE:TEXT]' >> "$DF_FOLDER/data/init/init.txt"
echo '[SOUND:NO]' >> "$DF_FOLDER/data/init/init.txt"
echo '' >> "$DF_FOLDER/df_linux/data/init/init.txt"
echo '[PRINT_MODE:TEXT]' >> "$DF_FOLDER/df_linux/data/init/init.txt"
echo '[SOUND:NO]' >> "$DF_FOLDER/df_linux/data/init/init.txt"
echo Done
echo "$selfmd5" > receipt
ls