Better error handling

master
Perttu Ahola 2012-11-28 10:50:21 +02:00
parent 9e990b25d3
commit 3bed63205c
2 changed files with 10 additions and 6 deletions

View File

@ -15,10 +15,10 @@ worlddir=$2
#echo "-- Making world in $worlddir using $gamedir"
echo "-- Making world `basename $worlddir`"
pushd "$gamedir" &>/dev/null
pushd "$gamedir" &>/dev/null || exit 1
# Configuration file is the common runtime configuration method
echo -e "map-dir = $worlddir\nenable_mapgen_debug_info = true\n" > worldtest_config
mkdir -p "$worlddir"
mkdir -p "$worlddir" || exit 1
if ! [ -a "$worlddir/world.mt" ]; then
echo -e 'gameid = minimal' > "$worlddir/world.mt"
fi

View File

@ -50,11 +50,11 @@ build_minetest ()
pkg=$3
mtdir=$4
rm -rf "$mtdir"
mkdir -p "$mtdir"
pushd "$mtdir" &>/dev/null
rm -rf "$mtdir" || return 1
mkdir -p "$mtdir" || return 1
pushd "$mtdir" &>/dev/null || return 1
# Extract package
tar -xf "$pkg"
tar -xf "$pkg" || return 1
# Patch stuff
for patchfile in $ruledir/*.patch; do
@ -71,6 +71,10 @@ build_minetest ()
# Build it
cmake . -DRUN_IN_PLACE=1 -DBUILD_CLIENT=0
if [ "$?" == "1" ]; then
echo "EE Error preparing build for $tag"
return 1
fi
make -j2
if [ "$?" == "1" ]; then
echo "EE Error building $tag"