From 963393ce85f766a33ae910c60586e89ba27d569c Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Tue, 16 Oct 2018 20:38:05 -0400 Subject: [PATCH] Fix decompile script json regex When Mojang added 1.13.2-pre2 to their manifest page it exposed a flaw in the way the script's regex was getting the version json manifest. I've tweaked the regex such that it will always first get the version entry and then use that entry to get the json url, rather than trying to do the whole thing in one shot. Fixes GH-1582 --- scripts/decompile.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/decompile.sh b/scripts/decompile.sh index 12d5b075fc..c52dcf6f5f 100755 --- a/scripts/decompile.sh +++ b/scripts/decompile.sh @@ -25,7 +25,11 @@ versionjson="$workdir/Minecraft/$minecraftversion/$minecraftversion.json" if [ ! -f "$versionjson" ]; then echo "Downloading $minecraftversion JSON Data" verescaped=$(echo ${minecraftversion} | sed 's/\./\\./g') - jsonurl=$(curl -s "https://launchermeta.mojang.com/mc/game/version_manifest.json" | grep -oE "https://.*?${verescaped}.json") + echo $verescaped + verentry=$(curl -s "https://launchermeta.mojang.com/mc/game/version_manifest.json" | grep -oE "{\"id\": \"${verescaped}\".*?\.json") + echo $verentry + jsonurl=$(echo $verentry | grep -oE https:\/\/.*?\.json) + echo $jsonurl curl -o "$versionjson" "$jsonurl" echo "$versionjson - $jsonurl" fi