-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherlang.bits
More file actions
46 lines (39 loc) · 1.06 KB
/
erlang.bits
File metadata and controls
46 lines (39 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash -e
#
# Take a look
# https://www.erlang-solutions.com/downloads/
#
# then Look at the download URL, like
# href="https://packages.erlang-solutions.com/erlang/debian/pool/esl-erlang_23.2.3-1~ubuntu~xenial_arm64.deb"
#
# The version number would be
# 23.2.3-1
#-----------
# VARIABLES
#-----------
ERLANG_VERSION=${ERLANG_VERSION-23.2-1}
LINUX_DISTRIBUTION=${LINUX_DISTRIBUTION-$(lsb_release -cs)}
#-----------
# HELPERS
#-----------
set_env()
{
KEY=$1
VAL=$2
echo "export $KEY=$VAL" >> $HOME/.bash_aliases
}
#-----------
# INSTALLER
#-----------
if [ "$(which brew)" == "" ]; then
LINUX_DISTRIBUTION=${LINUX_DISTRIBUTION-$(lsb_release -cs)}
locale-gen en_US.UTF-8
set_env ERLANG_VERSION $ERLANG_VERSION
source $HOME/.bash_aliases
apt-get update
apt-get install -y wget git build-essential libsctp1
wget https://packages.erlang-solutions.com/erlang/debian/pool/esl-erlang_${ERLANG_VERSION}~ubuntu~${LINUX_DISTRIBUTION}_amd64.deb
dpkg --force-depends -i esl-erlang_${ERLANG_VERSION}~ubuntu~${LINUX_DISTRIBUTION}_amd64.deb
else
brew install erlang
fi