make script accept --experimental, will setup the build matrix later
This commit is contained in:
parent
119ffbc758
commit
cba9bf6005
1 changed files with 7 additions and 1 deletions
|
@ -4,7 +4,13 @@
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
Version=$1
|
Version=$1
|
||||||
BuildJSON=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" https://papermc.io/api/v2/projects/paper/versions/$Version/builds)
|
BuildJSON=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" https://papermc.io/api/v2/projects/paper/versions/$Version/builds)
|
||||||
Build=$(echo "$BuildJSON" | jq '[.builds[] | select(.channel == "default" or .channel == "experimental")][-1].build')
|
|
||||||
|
if [[ "${2:-}" == "--experimental" ]] ; then
|
||||||
|
Build=$(echo "$BuildJSON" | jq '[.builds[] | select(.channel == "default" or .channel == "experimental")][-1].build')
|
||||||
|
else
|
||||||
|
Build=$(echo "$BuildJSON" | jq '[.builds[] | select(.channel == "default")][-1].build')
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo $BuildJSON | jq
|
echo $BuildJSON | jq
|
||||||
curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" -o paperclip.jar "https://papermc.io/api/v2/projects/paper/versions/$Version/builds/$Build/downloads/paper-$Version-$Build.jar"
|
curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" -o paperclip.jar "https://papermc.io/api/v2/projects/paper/versions/$Version/builds/$Build/downloads/paper-$Version-$Build.jar"
|
||||||
|
|
Loading…
Add table
Reference in a new issue