From a98c0c401638f5b6fc5c3c6320f60b8c720366db Mon Sep 17 00:00:00 2001 From: ysthakur <45539777+ysthakur@users.noreply.github.com> Date: Sat, 15 Jul 2023 18:00:49 -0400 Subject: [PATCH] Add ammonite itself to .tool-versions --- .tool-versions | 1 + lib/utils.bash | 1 + 2 files changed, 2 insertions(+) diff --git a/.tool-versions b/.tool-versions index 3d11f88..a4bc508 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,3 @@ shellcheck 0.9.0 shfmt 3.6.0 +amm 2.13-2.5.9 diff --git a/lib/utils.bash b/lib/utils.bash index e1418c8..d4a05d1 100644 --- a/lib/utils.bash +++ b/lib/utils.bash @@ -19,6 +19,7 @@ if [ -n "${GITHUB_API_TOKEN:-}" ]; then curl_opts=("${curl_opts[@]}" -H "Authorization: Bearer $GITHUB_API_TOKEN") fi +# todo sort by only Ammonite version, not Scala version 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}'