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
This commit is contained in:
Zach Brown 2018-10-16 20:38:05 -04:00
parent 06f15f54ba
commit 1944b6bd54
No known key found for this signature in database
GPG Key ID: CC9DA35FC5450B76
1 changed files with 5 additions and 1 deletions

View File

@ -25,7 +25,11 @@ versionjson="$workdir/Minecraft/$minecraftversion/$minecraftversion.json"
if [ ! -f "$versionjson" ]; then if [ ! -f "$versionjson" ]; then
echo "Downloading $minecraftversion JSON Data" echo "Downloading $minecraftversion JSON Data"
verescaped=$(echo ${minecraftversion} | sed 's/\./\\./g') 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" curl -o "$versionjson" "$jsonurl"
echo "$versionjson - $jsonurl" echo "$versionjson - $jsonurl"
fi fi