-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·64 lines (54 loc) · 939 Bytes
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash -x
echo $PWD
function install_bash() {
echo "Installing bash related stuff."
source scripts/deploy_bash.sh
}
function install_zsh() {
echo "Installing zsh related stuff."
source scripts/deploy_zsh.sh
}
function install_common() {
source scripts/deploy_git.sh
source scripts/deploy_vim.sh
}
UNATTENDED=0
while [[ $# -gt 1 ]]
do
key="$1"
case $key in
-n | --unattended)
UNATTENDED=1
shift # past argument
;;
-s | --shell)
SHELL=$2
shift # past argument
;;
*)
echo "Invalid argument given: $1"
;;
esac
shift
done
echo "Deploying dotfiles"
if ! [ -z ${SHELL+x} ] && [ $UNATTENDED -eq 0 ]; then
read -p "Which shells, zsh, bash or both?" SHELL
export SHELL
fi
install_common
case $SHELL in
'zsh' )
install_zsh
;;
'bash' )
install_bash
;;
'both' )
install_zsh
install_bash
;;
* )
echo "Invalid shell option."
;;
esac