Confirm latest Spigot jar is always downloaded

This commit is contained in:
Geoff Bourne committed 2020-07-11 13:17:28 -05:00
1 parent a07ae685e2
commit 38028f7d0c
1 file changed
+11 -7
+11 -7
View File
@@ -62,8 +62,12 @@ function downloadSpigot {
downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar" downloadUrl="https://cdn.getbukkit.org/${getbukkitFlavor}/${getbukkitFlavor}-${VANILLA_VERSION}.jar"
fi fi
if [ -f $SERVER ]; then
# tell curl to only download when newer
zarg="-z $SERVER"
fi
log "Downloading $match from $downloadUrl ..." log "Downloading $match from $downloadUrl ..."
curl -fsSL -o $SERVER "$downloadUrl" curl -fsSL -o $SERVER $zarg "$downloadUrl"
if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then if [[ $? != 0 || $(grep -c "DOCTYPE html" $SERVER) != 0 ]]; then
cat <<EOF cat <<EOF
@@ -89,12 +93,12 @@ case "$TYPE" in
;; ;;
esac esac
if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then if isTrue "$BUILD_SPIGOT_FROM_SOURCE" || isTrue "$BUILD_FROM_SOURCE"; then
if isTrue "$BUILD_SPIGOT_FROM_SOURCE" || isTrue "$BUILD_FROM_SOURCE"; then if [ ! -f $SERVER ] || [ -n "$FORCE_REDOWNLOAD" ]; then
buildSpigotFromSource buildSpigotFromSource
else fi
downloadSpigot else
fi downloadSpigot
fi fi
# Normalize on Spigot for operations below # Normalize on Spigot for operations below