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