Skip to content

Commit

Permalink
Update install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
asdfugil committed Jul 22, 2024
1 parent a897830 commit 16d6fd6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ case "$1" in
;;
*)
if [ "$china" = "1" ]; then
download_version=$(curl -s https://cdn.nickchan.lol/palera1n/c-rewrite/releases/ | grep 'a href="v' | tail -n1 | cut -d'>' -f2 | cut -d/ -f1)
download_version=$(curl -s https://cdn.nickchan.lol/palera1n/c-rewrite/releases/ | grep 'a href="v' | grep -v beta | tail -n1 | cut -d'>' -f2 | cut -d/ -f1)
else
download_version=$(curl -s https://api.github.com/repos/palera1n/palera1n/releases | grep -m 1 -o '"tag_name": "[^"]*' | sed 's/"tag_name": "//')
fi
Expand All @@ -186,6 +186,7 @@ info "Found OS type ($os_name $arch)."
# =========

if [ "$china" = "1" ]; then
download_suffix="binaries/"
download_prefix="https://cdn.nickchan.lol/palera1n/c-rewrite/releases"
else
download_prefix="https://github.com/palera1n/palera1n/releases/download"
Expand All @@ -197,10 +198,10 @@ rm /usr/local/bin/palera1n > /dev/null 2>&1

case "$os" in
Linux)
download "${download_prefix}/${download_version}/palera1n-linux-${arch}"
download "${download_prefix}/${download_version}/${download_suffix}palera1n-linux-${arch}"
;;
Darwin)
download "${download_prefix}/${download_version}/palera1n-macos-${arch}"
download "${download_prefix}/${download_version}/${download_suffix}palera1n-macos-${arch}"
;;
esac

Expand Down

0 comments on commit 16d6fd6

Please sign in to comment.