From 3a2172c284ad2809aed5ae446c74099c599afec7 Mon Sep 17 00:00:00 2001 From: Ben Berry-Allwood Date: Wed, 8 Jan 2025 13:24:02 +0000 Subject: [PATCH] chore: remove sort_versions as versions already in order --- bin/latest-stable | 1 - bin/list-all | 2 +- lib/utils.bash | 5 ----- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/bin/latest-stable b/bin/latest-stable index d719403..4b89048 100755 --- a/bin/latest-stable +++ b/bin/latest-stable @@ -10,5 +10,4 @@ plugin_dir=$(dirname "$(dirname "$current_script_path")") list_versions "$CURRENT_DOWNLOADS_URL" | grep -v "preview" | - sort_versions | tail -n 1 diff --git a/bin/list-all b/bin/list-all index 48d86fc..cd683b8 100755 --- a/bin/list-all +++ b/bin/list-all @@ -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" diff --git a/lib/utils.bash b/lib/utils.bash index 115f65c..57b78ef 100644 --- a/lib/utils.bash +++ b/lib/utils.bash @@ -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" |