summaryrefslogtreecommitdiffstats
path: root/lang/erlang/test-version.sh
blob: 413072a769c243a09d0aea3d902da5786c244015 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh
# erl -version prints ERTS version, not OTP release — use system_info instead
case "$1" in
erlang)
	otp_major="${2%%.*}"
	timeout 60s erl -noshell \
		-eval "V = erlang:system_info(otp_release), io:format(\"OTP ~s~n\", [V])" \
		-s init stop 2>&1 | \
		grep -F "OTP ${otp_major}"
	;;
esac