diff --git a/bin/latest-stable b/bin/latest-stable deleted file mode 100755 index 818f26e..0000000 --- a/bin/latest-stable +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -current_script_path=${BASH_SOURCE[0]} -plugin_dir=$(dirname "$(dirname "$current_script_path")") - -# shellcheck source=./lib/utils.bash -. "${plugin_dir}/lib/utils.bash" - -curl_opts=(-sI) - -if [ -n "${GITHUB_API_TOKEN:-}" ]; then - curl_opts=("${curl_opts[@]}" -H "Authorization: token $GITHUB_API_TOKEN") -fi - -# curl of REPO/releases/latest is expected to be a 302 to another URL -# when no releases redirect_url="REPO/releases" -# when there are releases redirect_url="REPO/releases/tag/v" -redirect_url=$(curl "${curl_opts[@]}" "$GH_REPO/releases/latest" | sed -n -e "s|^location: *||p" | sed -n -e "s|\r||p") -version= -printf "redirect url: %s\n" "$redirect_url" >&2 -if [[ "$redirect_url" == "$GH_REPO/releases" ]]; then - version="$(list_all_versions | sort_versions | tail -n1 | xargs echo)" -else - version="$(printf "%s\n" "$redirect_url" | sed 's|.*/tag/v\{0,1\}||')" -fi - -printf "%s\n" "$version"