Skip to content

Commit

Permalink
added checks for available releases
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed May 28, 2021
1 parent 9c2ed99 commit 5955aed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ setDesiredVersion() {
else
TAG=$DESIRED_VERSION
TAG_WO_VER=$(echo "${TAG}" | cut -c 2-)

if type "curl" &>/dev/null; then
if ! curl -s -o /dev/null --fail https://api.github.com/repos/$REPO_NAME/releases/tags/$DESIRED_VERSION; then
echo "release $DESIRED_VERSION not found"
exit 1
fi
elif type "wget" &>/dev/null; then
if ! wget -q https://api.github.com/repos/$REPO_NAME/releases/tags/$DESIRED_VERSION; then
echo "release $DESIRED_VERSION not found"
exit 1
fi
fi
fi
}

Expand Down

0 comments on commit 5955aed

Please sign in to comment.