diff --git a/bin/latest-stable b/bin/latest-stable index 0797199..afe46b3 100755 --- a/bin/latest-stable +++ b/bin/latest-stable @@ -11,16 +11,16 @@ source "${plugin_dir}/lib/utils.bash" curl_opts=(-sI) if [ -n "${GITHUB_API_TOKEN:-}" ]; then - curl_opts=("${curl_opts[@]}" -H "Authorization: token $GITHUB_API_TOKEN") + curl_opts=("${curl_opts[@]}" -H "Authorization: token $GITHUB_API_TOKEN") fi redirect_url=$(curl "${curl_opts[@]}" "$REPO_URL/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" == "$REPO_URL/releases" ]]; then - version="$(list_github_releases | sort_versions | tail -n1 | xargs echo)" + version="$(list_github_releases | sort_versions | tail -n1 | xargs echo)" else - version="$(printf "%s\n" "$redirect_url" | sed 's|.*/tag/bun-v||')" + version="$(printf "%s\n" "$redirect_url" | sed 's|.*/tag/bun-v||')" fi printf "%s\n" "$version"