From ffec50141ab86f9fc52a7317f8c92e74b87ff7e9 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Thu, 28 Jan 2021 20:55:08 -0600 Subject: [PATCH] Fixed MODS provides from github release URLs For #731 --- start-finalSetupModpack | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/start-finalSetupModpack b/start-finalSetupModpack index 7e477582..3e4416ee 100644 --- a/start-finalSetupModpack +++ b/start-finalSetupModpack @@ -81,16 +81,23 @@ if [[ "$MODS" ]]; then do if isURL $i; then log "Downloading mod/plugin $i ..." - effective_url=$(resolveEffectiveUrl "$i") - if isValidFileURL jar "${effective_url}"; then - out_file=$(getFilenameFromUrl "${effective_url}") - if ! curl -fsSL -o "${out_dir}/$out_file" "${effective_url}"; then + if isValidFileURL jar "$i"; then + if ! curl -fsSL -o "${out_dir}/$(getFilenameFromUrl "${i}")" "${i}"; then log "ERROR: failed to download from $i into $out_dir" exit 2 fi else - log "ERROR: $effective_url resolved from $i is not a valid jar URL" - exit 2 + effective_url=$(resolveEffectiveUrl "$i") + if isValidFileURL jar "${effective_url}"; then + out_file=$(getFilenameFromUrl "${effective_url}") + if ! curl -fsSL -o "${out_dir}/$out_file" "${effective_url}"; then + log "ERROR: failed to download from $i into $out_dir" + exit 2 + fi + else + log "ERROR: $effective_url resolved from $i is not a valid jar URL" + exit 2 + fi fi else log "ERROR Invalid URL given in MODS: $i"