>&2 echo "[lmk-run] Error: '$PRE_CMD perl mtcompile-program.pl build --$LMK_MODE $APP_ARG' failed in `pwd` with code $code."
exit 1
fi
else
echo "[lmk-run] using existing `pwd`/minetest/bin/$EXE_NAME"
fi
cd minetest/bin
if [ $? -ne 0 ]; then
PRE_CMD=""
>&2 echo "[lmk-run] 'cd minebest/bin' failed in `pwd`."
fi
#if "x$APP" = "xserver" ]; then
echo "* Looking for a test world to copy..."
if [ "x$SRC_WORLD" = "x" ]; then
SRC_WORLD="$3"
else
SRC_WORLD=
fi
if [ "x$SRC_WORLD" = "x" ]; then
for dir in ~/minetest-220509/worlds/bg190406 /home/owner/bg190406
do
printf "* checking for \"$dir\"..."
if [ -d $dir ]; then
SRC_WORLD="$dir"
break
fi
done
fi
if [ "x$SRC_WORLD" = "x" ]; then
echo "No known test world was found. Try making a small world first, and specify it as the 3rd parameter or set SRC_WORLD in the environment. Note that the gameid in the file must exist."
exit 1
else
echo "[lmk-run] found $SRC_WORLD to copy"
fi
world_name="`basename $SRC_WORLD`"
mkdir -p ~/tmp
dst_world="$HOME/tmp/${world_name}-$EXE_NAME"
echo "[lmk-run] syncing to $dst_world destructively..."