Skip to content

Commit

Permalink
fix: filter out releases with the 'app@' prefix from the latest-stabl…
Browse files Browse the repository at this point in the history
…e script (#28)

* Filter out releases with the 'app@' prefix from the latest-stable script

* Run format.bash

---------

Co-authored-by: fortmarek <marekfort@me.com>
  • Loading branch information
pepicrft and fortmarek authored Aug 26, 2024
1 parent 923b26a commit 8d6fb84
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/latest-stable
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@ redirect_url=$(curl "${curl_opts[@]}" "$GH_REPO/releases/latest" | sed -n -e "s|
version=
printf "redirect url: %s\n" "$redirect_url" >&2
if [[ "$redirect_url" == "$GH_REPO/releases" ]]; then
version="$(list_all_versions_sorted | tail -n1 | xargs echo)"
# Get the latest version excluding those with 'app@' prefix
version="$(list_all_versions_sorted | grep -v '^app@' | tail -n1 | xargs echo)"
else
version="$(printf "%s\n" "$redirect_url" | sed 's|.*/tag/v\{0,1\}||')"
# Check if the version has 'app@' prefix and fetch an alternative version if it does
if [[ "$version" == app@* ]]; then
version="$(list_all_versions_sorted | grep -v '^app@' | tail -n1 | xargs echo)"
fi
fi

printf "%s\n" "$version"

0 comments on commit 8d6fb84

Please sign in to comment.