-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversion-erl
executable file
·23 lines (22 loc) · 1016 Bytes
/
version-erl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env sh
# Name: version-erl
# Abstract: Print version of currently available Erlang on stdout.
# Requires: Accessible Erlang binaries: uses erl.
# Used by : PEL Emacs support for Erlang to auto-detect available Erlang version.
# Last Modified Time-stamp: <2021-10-15 21:16:08, updated by Pierre Rouleau>
# -----------------------------------------------------------------------------
# Description
# -----------
#
# Usage: version-erl
#
# This uses an inline Erlang statement passed to the Erlang interpreter.
# ----------------------------------------------------------------------------
# Script
# ------
#
# Note: the `-sasl errlog_type error` prevents printing PROGRESS REPORT
# on some versions of Erlang.
#
erl -sasl errlog_type error -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"])), io:fwrite(Version), halt().' -noshell
# -----------------------------------------------------------------------------