diff --git a/bin/latest-stable b/bin/latest-stable index 2eb67b5..95088be 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