Skip to content

Commit

Permalink
Change checks on version number, this should work
Browse files Browse the repository at this point in the history
  • Loading branch information
martintc committed Oct 19, 2024
1 parent 4a17606 commit d53d490
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@
export SUCCESS_CMD="$REPO --help"
export BINLOCATION="/usr/local/bin"

if [[ ! ${VERSION} ]]; then
version=$(curl -sI https://github.com/$OWNER/$REPO/releases/latest | grep -i "location:" | awk -F"/" '{ printf "%s", $NF }' | tr -d '\r')
else
version=${VERSION}
fi

status_code=$(curl -sI -o /dev/null -w "%{http_code}" https://github.com/$OWNER/$REPO/releases/${version})

version=$(curl -sI https://github.com/$OWNER/$REPO/releases/${VERSION:=latest} | grep -i "location:" | awk -F"/" '{ printf "%s", $NF }' | tr -d '\r')
if [ ! $version ]; then
if [ "$status_code" -eq 404 ]; then
echo "Failed while attempting to install $REPO. Please manually install:"
echo ""
echo "1. Open your web browser and go to https://github.com/$OWNER/$REPO/releases"
Expand Down

0 comments on commit d53d490

Please sign in to comment.