Added debug logging of bukkit/spigot curl download

For #655
This commit is contained in:
Geoff Bourne 2020-11-03 16:49:38 -06:00
parent 4099cde737
commit 391e807c78

View file

@ -67,12 +67,16 @@ function downloadSpigot {
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
fi
setServerVar
if [ -f $SERVER ]; then
# tell curl to only download when newer
zarg="-z $SERVER"
curlArgs="-z $SERVER"
fi
if isDebugging; then
curlArgs="$curlArgs -v"
fi
log "Downloading $match from $downloadUrl ..."
curl -fsSL -o $SERVER $zarg "$downloadUrl"
curl -fsSL -o $SERVER $curlArgs "$downloadUrl"
if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then
cat <<EOF
@ -88,17 +92,19 @@ EOF
export JVM_OPTS
}
case "$TYPE" in
*BUKKIT|*bukkit)
export SERVER=craftbukkit_server-${VANILLA_VERSION}.jar
;;
*)
export SERVER=spigot_server-${VANILLA_VERSION}.jar
;;
esac
function setServerVar {
case "$TYPE" in
*BUKKIT|*bukkit)
export SERVER=craftbukkit_server-${VANILLA_VERSION}.jar
;;
*)
export SERVER=spigot_server-${VANILLA_VERSION}.jar
;;
esac
}
if isTrue "$BUILD_SPIGOT_FROM_SOURCE" || isTrue "$BUILD_FROM_SOURCE"; then
setServerVar
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
buildSpigotFromSource
fi