-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·48 lines (29 loc) · 1.01 KB
/
setup.sh
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
#!/usr/bin/env bash
############################################
# Prepare environment
asdf_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$asdf_dir"
# Load predefined functions
. ../utils/functions.sh
############################################
# Script body
info "Installing asdf..."
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
if [[ -f "$HOME/.bashrc" ]]; then
info "Adding asdf to .bashrc..."
pushUniqueLine ". \$HOME/.asdf/asdf.sh" "$HOME/.bashrc"
pushUniqueLine ". \$HOME/.asdf/completions/asdf.bash" "$HOME/.bashrc"
fi
if [[ -f "$HOME/.zshrc" ]]; then
info "Adding asdf to .zshrc..."
pushUniqueLine ". \$HOME/.asdf/asdf.sh" "$HOME/.zshrc"
pushUniqueLine ". \$HOME/.asdf/completions/asdf.bash" "$HOME/.zshrc"
fi
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
find * -name "*.sh" -not -path "setup.sh" | while read setup; do
# NOTE: We cd back to make sure the directory is correct
cd "$asdf_dir"
info "Running $setup..."
. ./$setup
done