Skip to content

Commit

Permalink
Merge pull request #11 from robzr/dev
Browse files Browse the repository at this point in the history
suppress output
  • Loading branch information
robzr authored Apr 9, 2024
2 parents 33c4f38 + bd059c7 commit a853d04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
8 changes: 1 addition & 7 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,4 @@

set -euo pipefail

cat <<'_EOF_'
asdf sync runs as an asdf extension, there is no additional tool to install
or run. To update, run "asdf plugin update sync".
For help, run "asdf sync help".
_EOF_
true
7 changes: 3 additions & 4 deletions bin/latest-stable
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@ plugin_dir=$(dirname "$(dirname "$current_script_path")")
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

# 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<VERSION>"
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)"
version="$(list_all_versions | sort_versions | tail -n1 | xargs echo)"
else
version="$(printf "%s\n" "$redirect_url" | sed 's|.*/tag/v\{0,1\}||')"
version="$(printf "%s\n" "$redirect_url" | sed 's|.*/tag/v\{0,1\}||')"
fi

printf "%s\n" "$version"

0 comments on commit a853d04

Please sign in to comment.