From 00106ba1ba81f600471f148e787ffc48ca95fda8 Mon Sep 17 00:00:00 2001 From: Tomasz Marek Sulima Date: Fri, 28 Mar 2025 18:10:54 +0200 Subject: [PATCH 1/3] Add dot to tr command to ensure that only major number is returned --- bin/latest-stable | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/latest-stable b/bin/latest-stable index e110ca7..2557605 100755 --- a/bin/latest-stable +++ b/bin/latest-stable @@ -12,7 +12,7 @@ ASDF_ELIXIR_LATEST_VERSION=$(./list-all | grep -Pv "^0|^main|^master|otp|rc|^$" # gets current erlang version without headers # changes spaces to new line # takes second line (Name Version Source Installed) -ASDF_ELIXIR_LATEST_OTP=$(asdf current --no-header erlang | tr -s " " "\n" | sed -n 2p) +ASDF_ELIXIR_LATEST_OTP=$(asdf current --no-header erlang | tr -s " ." "\n" | sed -n 2p) # Note: asdf latest does not allows latest stable version to start with number # therefore installing from source by git ref is not supported, see: From 34aec650c1ed703049a66880f1a3cfb6e6aaf69c Mon Sep 17 00:00:00 2001 From: Tomasz Marek Sulima Date: Fri, 28 Mar 2025 18:20:40 +0200 Subject: [PATCH 2/3] Added missing tr command for list-all script list-all script have different behaviour than `asdf list all` command --- bin/latest-stable | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/latest-stable b/bin/latest-stable index 2557605..8b51d29 100755 --- a/bin/latest-stable +++ b/bin/latest-stable @@ -7,7 +7,7 @@ # reject release candidates # reject empty line # finally take last one -ASDF_ELIXIR_LATEST_VERSION=$(./list-all | grep -Pv "^0|^main|^master|otp|rc|^$" | tail -n 1) +ASDF_ELIXIR_LATEST_VERSION=$(./list-all | tr " " "\n" | grep -Pv "^0|^main|^master|otp|rc|^$" | tail -n 1) # gets current erlang version without headers # changes spaces to new line From ac0f7263563bd5ed3e3e1078a35f959a7cdd2438 Mon Sep 17 00:00:00 2001 From: Tomasz Marek Sulima Date: Fri, 28 Mar 2025 18:26:19 +0200 Subject: [PATCH 3/3] Replace platform-specific perl (-P) regex flag to crossplatform extended (-E) regex flag Fixes support for *BSD distributions and macOS --- bin/latest-stable | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/latest-stable b/bin/latest-stable index 8b51d29..2eb67b5 100755 --- a/bin/latest-stable +++ b/bin/latest-stable @@ -7,7 +7,7 @@ # reject release candidates # reject empty line # finally take last one -ASDF_ELIXIR_LATEST_VERSION=$(./list-all | tr " " "\n" | grep -Pv "^0|^main|^master|otp|rc|^$" | tail -n 1) +ASDF_ELIXIR_LATEST_VERSION=$(./list-all | tr " " "\n" | grep -Ev "^0|^main|^master|otp|rc|^$" | tail -n 1) # gets current erlang version without headers # changes spaces to new line