-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·82 lines (77 loc) · 1.81 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
set -e
DRY_RUN=${2:-"false"}
BASE_DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
source $BASE_DIR/.bash_colors
TARGET=${TARGET:-$HOME}
installVim(){
_install ".vim .vimrc" "vim"
}
installBash(){
_install ".bashrc .shell_aliases .shell_functions .bash_colors" "bash"
_install ".screenrc" "screen"
_install ".inputrc" "inputrc"
_install ".tmux.conf" "tmux"
}
installZsh(){
_install ".zshrc .shell_functions .shell_aliases .p10k.zsh" "zsh"
_install ".screenrc" "screen"
_install ".tmux.conf" "tmux"
}
installGit(){
_install ".gitconfig" "git"
}
installSlate(){
_install ".slate" "slate"
}
installKarabiner(){
echo -ne "\033[00;${COLOR_WHITE}mInstalling karabiner configuration file...\033[0m"
if [ "${DRY_RUN}" == "false" ]; then
ln -sf "${BASE_DIR}/karabiner/private.xml" "${TARGET}/Library/Application Support/Karabiner/private.xml"
else
echo Executing: ln -sf "${BASE_DIR}/karabiner/private.xml" "${TARGET}/Library/Application Support/Karabiner/private.xml"
fi
echo -e "[\033[01;${COLOR_GREEN}mDone\033[0m]"
}
installTerminalStuff(){
_install ".dircolors" "dircolors"
}
installIrssi(){
_install ".irssi" "irssi"
}
_install(){
echo -ne "\033[00;${COLOR_WHITE}mInstalling $2 configuration...\033[0m"
for f in $1; do
if [ "${DRY_RUN}" == "false" ]; then
ln -sf "${BASE_DIR}/${f}" "${TARGET}/${f}"
else
echo Executing: ln -sf "${BASE_DIR}/${f}" "${TARGET}/${f}"
fi
done
echo -e "[\033[01;${COLOR_GREEN}mDone\033[0m]"
}
case "$1" in
"dev-linux")
bash $0 "bash" ${DRY_RUN}
installGit
installVim
;;
"mac")
bash $0 "dev-linux" ${DRY_RUN}
installZsh
# installSlate
# installKarabiner
;;
"linux")
bash $0 "dev-linux" ${DRY_RUN}
installIrssi
;;
"bash")
installBash
installTerminalStuff
;;
*)
echo "$0 (dev-linux | mac | linux | bash) <?DRY_RUN:true/false>"
exit 1
;;
esac