Skip to content

Commit

Permalink
format script
Browse files Browse the repository at this point in the history
  • Loading branch information
cometkim authored Nov 1, 2024
1 parent 48556e3 commit 019058c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/latest-stable
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 019058c

Please sign in to comment.