-
Notifications
You must be signed in to change notification settings - Fork 3
/
dotfiles
executable file
·91 lines (77 loc) · 2.09 KB
/
dotfiles
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
83
84
85
86
87
88
89
90
91
#!/bin/bash
BIN_NAME="$(basename "$0")"
COMMAND_NAME=$1
sub_help () {
echo "Usage: $BIN_NAME <command>\n"
echo "Commands:"
echo " help This help message"
echo " reload Reload dotfiles"
echo " system Install basic setup for Ubuntu"
echo " pro Install diffrent programmuing env"
echo " shell Install, source and link dotfiles to bash and zhs"
echo " sublime Install Sublime Text 3 and custom plugins"
echo " atom Install Atom text editor"
echo " emacs Install Emacs and spacemac "
echo " vim Install Vim and custom plugins using Vundle"
echo " vscode Install VSCode"
echo " all Install using all options"
}
sub_reload () {
source "/home/$USER/.bash_profile" && echo "Bash reloaded."
}
sub_system () {
sudo chmod +x install/system-install.bash
bash install/system-install.bash
}
sub_pro () {
sudo chmod +x install/pro-install.bash
bash install/pro-install.bash
}
sub_shell () {
sudo chmod +x install/shell-install.bash
bash install/shell-install.bash
}
sub_sublime () {
sudo chmod +x sublime/sublime-install.bash
bash install/sublime-install.bash
}
sub_atom () {
sudo chmod +x install/atom-install.bash
bash install/atom-install.bash
}
sub_vim () {
sudo chmod +x vim/vim-install.bash
bash install/vim-install.bash
}
sub_emacs () {
sudo chmod +x install/emacs-install.bash
bash install/emacs-install.bash
}
sub_vscode () {
sudo chmod +x install/vscode-install.bash
bash install/vscode-install.bash
}
sub_all () {
sub_system
sub_pro
sub_sublime
sub_atom
sub_vim
sub_emacs
sub_vscode
sub_shell
}
case $COMMAND_NAME in
"" | "-h" | "--help")
sub_help
;;
*)
shift
"sub_${COMMAND_NAME}" "$@"
if [ $? = 127 ]; then
echo "'$COMMAND_NAME' is not a known command or has errors." >&2
sub_help
exit 1
fi
;;
esac