-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·67 lines (59 loc) · 1.7 KB
/
install.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
command_exists() {
type "$1" >/dev/null
}
echoval() {
echo "$(eval echo $(cat $1))"
}
run_all() {
# shellcheck source=./xcode.sh
. "$start_dir/xcode.sh"
# shellcheck source=./brew.sh
. "$start_dir/brew.sh"
# shellcheck source=./ssh.sh
. "$start_dir/ssh.sh"
# shellcheck source=./directories.sh
. "$start_dir/directories.sh"
# shellcheck source=./gitconfig.sh
. "$start_dir/gitconfig.sh"
# shellcheck source=./mas.sh
. "$start_dir/mas.sh"
# shellcheck source=./zsh.sh
. "$start_dir/zsh.sh"
# shellcheck source=./prezto.sh
. "$start_dir/prezto.sh"
}
start_dir=$(pwd)
# shellcheck source=./options.sh
. "$start_dir/options.sh"
cat <<"EOF"
___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___
(___)(___)(___)(___)(___)(___)(___)(___)(___)(___)(___)(___)(___)
_ ____ __ ____ ____ __ __ ____ ____ _
( \ ( \ / \(_ _)( __)( )( ) ( __)/ ___) ( \
/ / ) D (( O ) )( ) _) )( / (_/\ ) _) \___ \ / /
\_) (____/ \__/ (__) (__) (__)\____/(____)(____/ \_)
___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___
(___)(___)(___)(___)(___)(___)(___)(___)(___)(___)(___)(___)(___)
EOF
while true; do
echo ""
echo "> Select one option using up/down keys and enter to confirm:"
echo ""
# shellcheck disable=SC2039
options=("all" "xcode" "brew" "ssh" "directories" "gitconfig" "mas" "zsh" "prezto" "exit")
select_option "${options[@]}"
choice=$?
# shellcheck disable=SC2039
option=${options[$choice]}
echo "Executing \"$option\" ..."
if [ "$option" = "exit" ]; then
echo "Bye!"
break
elif [ "$option" = "all" ]; then
run_all
else
# shellcheck disable=SC1090
. "$start_dir/$option.sh"
fi
done