Skip to content

Commit ee848f2

Browse files
authored
use --no-header flag only in latest asdf API (go builds)
v-dev builds are seen as latest (> 0.16.0)
1 parent ac0f726 commit ee848f2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/latest-stable

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ ASDF_ELIXIR_LATEST_VERSION=$(./list-all | tr " " "\n" | grep -Ev "^0|^main|^mast
1212
# gets current erlang version without headers
1313
# changes spaces to new line
1414
# takes second line (Name Version Source Installed)
15-
ASDF_ELIXIR_LATEST_OTP=$(asdf current --no-header erlang | tr -s " ." "\n" | sed -n 2p)
15+
if printf '0.16.0\n%s\n' $ASDF_VERSION | sort -CV; then
16+
# use --no-header flag only in latest asdf API (go builds)
17+
ASDF_ELIXIR_LATEST_OTP=$(asdf current --no-header erlang | tr -s " ." "\n" | sed -n 2p)
18+
else
19+
ASDF_ELIXIR_LATEST_OTP=$(asdf current erlang | tr -s " ." "\n" | sed -n 2p)
20+
fi
1621

1722
# Note: asdf latest does not allows latest stable version to start with number
1823
# therefore installing from source by git ref is not supported, see:

0 commit comments

Comments
 (0)