diff --git a/public/index.html b/public/index.html index a627bea..5745687 100755 --- a/public/index.html +++ b/public/index.html @@ -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"