-
Notifications
You must be signed in to change notification settings - Fork 5
/
install
executable file
·100 lines (81 loc) · 2.18 KB
/
install
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
92
93
94
95
96
97
98
99
100
#!/bin/bash
USAGE="$(basename "$0") [-i --ideavimrc] [-h --help] [-v --vim] [-t --tmux] [-f --fzf] [-a --alacritty] [-F fish]
OPTIONS
-h, --help
Print this message
-i, --ideavimrc
Install IdeaVim rc file
-g, --gitconfig
Install gitconfig extensions
-a, --alacritty
Install VIM plugins & syntax
-v, --vim
Install VIM plugins & syntax
-t, --tmux
Install tmux addons
-f, --fzf
Install fzf config
-F, --fish
Install fish config
-z, --zsh
Install zsh config\n"
if [[ -z $1 ]]; then
printf "$USAGE"
exit 0
fi
DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CP="/bin/cp -vfr"
INSTALL_VIM=false
INSTALL_ZSH=false
INSTALL_TMUX=false
INSTALL_FZF=false
INSTALL_ALACRITTY=false
INSTALL_FISH=false
INSTALL_IDEAVIMRC=false
INSTALL_GITCONFIG=false
if ! OPTIONS=$(getopt -o ihvtafzFg -l ideavim,help,vim,tmux,fzf,alacritty,zsh,all,fish,gitconfig -- "$@")
then
# something went wrong, getopt will put out an error message for us
exit 1
fi
while [ $# -gt 0 ]; do
case $1 in
"-h" | "--help") printf "$USAGE"; exit 0 ;;
"-v" | "--vim") INSTALL_VIM=true ;;
"-z" | "--zsh") INSTALL_ZSH=true ;;
"-t" | "--tmux") INSTALL_TMUX=true ;;
"-f" | "--fzf") INSTALL_FZF=true ;;
"-a" | "--alacritty") INSTALL_ALACRITTY=true ;;
"-F" | "--fish") INSTALL_FISH=true ;;
"-i" | "--ideavim") INSTALL_IDEAVIMRC=true ;;
"-g" | "--gitconfig") INSTALL_GITCONFIG=true ;;
(--) shift; break;;
(-*) echo "$0: error - unrecognized option $1" 1>&2; exit 1;;
(*) break;;
esac
shift
done
if $INSTALL_VIM; then
"$DIR/installers/vim.sh"
fi
if $INSTALL_ZSH; then
"$DIR/installers/zsh.sh"
fi
if $INSTALL_TMUX; then
"$DIR/installers/tmux.sh"
fi
if $INSTALL_FZF; then
"$DIR/installers/fzf.sh"
fi
if $INSTALL_ALACRITTY; then
"$DIR/installers/alacritty.sh"
fi
if $INSTALL_FISH; then
"$DIR/installers/fish.sh"
fi
if $INSTALL_IDEAVIMRC; then
"$DIR/installers/ideavim.sh"
fi
if $INSTALL_GITCONFIG; then
"$DIR/installers/git-config.sh"
fi