Skip to content

Commit

Permalink
chore: remove sort_versions as versions already in order
Browse files Browse the repository at this point in the history
  • Loading branch information
benberryallwood committed Jan 8, 2025
1 parent 53e28ff commit 3a2172c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
1 change: 0 additions & 1 deletion bin/latest-stable
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ plugin_dir=$(dirname "$(dirname "$current_script_path")")

list_versions "$CURRENT_DOWNLOADS_URL" |
grep -v "preview" |
sort_versions |
tail -n 1
2 changes: 1 addition & 1 deletion bin/list-all
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ plugin_dir=$(dirname "$(dirname "$current_script_path")")
# shellcheck source=./lib/utils.bash
. "${plugin_dir}/lib/utils.bash"

list_versions "$ARCHIVE_URL" | sort_versions
list_versions "$ARCHIVE_URL"
5 changes: 0 additions & 5 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ fail() {
exit 1
}

sort_versions() {
sed 'h; s/[+-]/./g; s/.p\([[:digit:]]\)/.z\1/; s/$/.z/; G; s/\n/ /' |
LC_ALL=C sort -t. -k 1,1 -k 2,2n -k 3,3n -k 4,4n -k 5,5n | awk '{print $2}'
}

list_versions() {
local url="$1"
curl -s "$url" |
Expand Down

0 comments on commit 3a2172c

Please sign in to comment.