-
Notifications
You must be signed in to change notification settings - Fork 28
/
install
executable file
·69 lines (62 loc) · 2.53 KB
/
install
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
# This simple script should create the basic environment for
# EVM in the user's HOME if EVM_HOME is not set
if [[ -z "$EVM_HOME" ]]; then
EVM_HOME="$HOME/.evm"
fi
DIRS="erlang_tars erlang_versions evm_config scripts"
type wget >/dev/null 2>/dev/null
if [[ $? -eq "1" ]]; then
echo "Could not complete installation of evm."
echo "Please install wget."
exit 1
else
echo "wget found!"
fi
# For each dir, check whether it's already exists or not
for dir in $DIRS; do
if [[ ! -d "$EVM_HOME/$dir" ]]; then
mkdir -p "$EVM_HOME/$dir"
echo "$EVM_HOME/$dir successfully created"
else
echo "$EVM_HOME/$dir already exists and will not be replaced"
fi
done
# Create the config file
if [[ ! -f "$EVM_HOME/evm_config/erlang_default" ]]; then
touch "$EVM_HOME/evm_config/erlang_default"
echo "$EVM_HOME/evm_config/erlang_default succesfully created"
else
echo "$EVM_HOME/evm_config/erlang_default already exists and will not be replaced"
fi
# Copy the script
cp "evm" "$EVM_HOME/scripts"
echo
echo "
_______________ ____ _____
\_ _____/\ \ / // \
______ | __)_ \ Y // \ / \ ______
/_____/ | \ \ // Y \ /_____/
/_______ / \___/ \____|__ /
\/ \/
___________ .__
\_ _____/_______ | | _____ ____ ____
| __)_ \_ __ \| | \__ \ / \ / ___\
| \ | | \/| |__ / __ \_| | \/ /_/ >
/_______ / |__| |____/(____ /|___| /\___ /
\/ \/ \//_____/
____ ____ .__
\ \ / / ____ _______ ______|__| ____ ____
\ Y /_/ __ \\\\_ __ \/ ___/| | / _ \ / \\
\ / \ ___/ | | \/\___ \ | |( <_> )| | \
\___/ \___ >|__| /____ >|__| \____/ |___| /
\/ \/ \/
_____
/ \ _____ ____ _____ ____ ____ _______
/ \ / \ \__ \ / \ \__ \ / ___\ _/ __ \\\\_ __ \\
/ Y \ / __ \_| | \ / __ \_/ /_/ >\ ___/ | | \/
\____|__ /(____ /|___| /(____ /\___ / \___ >|__|
\/ \/ \/ \//_____/ \/
"
echo
echo "Execute 'source $EVM_HOME/scripts/evm' or add that to your ~/.bashrc or ~/.zshrc file"