From f716e9f4a429f65e58a424e6a6604082cd9ceeaa Mon Sep 17 00:00:00 2001 From: Navin Peiris Date: Mon, 7 Apr 2025 04:43:54 +0530 Subject: [PATCH 1/2] Use absolute path in latest-stable when calling list-all --- bin/latest-stable | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/latest-stable b/bin/latest-stable index 2eb67b5..94711be 100755 --- a/bin/latest-stable +++ b/bin/latest-stable @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# get the directory of the current script +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + # calling a script to list all elixir releases # reject releases before 1.0.0 (starting with 0) # reject main and master branches @@ -7,7 +10,7 @@ # reject release candidates # reject empty line # finally take last one -ASDF_ELIXIR_LATEST_VERSION=$(./list-all | tr " " "\n" | grep -Ev "^0|^main|^master|otp|rc|^$" | tail -n 1) +ASDF_ELIXIR_LATEST_VERSION=$($SCRIPT_DIR/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 From d129ab48aa26a8eb4a8c8d897666af6dae9f2cc4 Mon Sep 17 00:00:00 2001 From: Navin Peiris Date: Tue, 8 Apr 2025 05:33:51 +0530 Subject: [PATCH 2/2] Improve handling of paths with spaces --- bin/latest-stable | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/latest-stable b/bin/latest-stable index 94711be..95088be 100755 --- a/bin/latest-stable +++ b/bin/latest-stable @@ -10,7 +10,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # reject release candidates # reject empty line # finally take last one -ASDF_ELIXIR_LATEST_VERSION=$($SCRIPT_DIR/list-all | tr " " "\n" | grep -Ev "^0|^main|^master|otp|rc|^$" | tail -n 1) +ASDF_ELIXIR_LATEST_VERSION=$("$SCRIPT_DIR"/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