-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy
executable file
·68 lines (55 loc) · 1.79 KB
/
deploy
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
#!/usr/bin/env bash
dotfiles_path=$(dirname "$0")
print_help() {
cat <<EOF
This script is basically just a wrapper for stow. Although for vim and xmonad it does
some additional work that is needed for them to function properly.
For vim it initializes the git submodules so that all vim plugins are properly installed.
Available arguments are:
--deploy (Create symlinks for base dotfiles: git zsh vim antigen)
--conclude (Delete symlinks for base dotfiles: git zsh vim antigen)
--vim (For creating the necessary folders, installation of plugins, and symlinking)
--antigen (For creating the necessary folders, installation of plugins, and symlinking)
EOF
}
#+++++++++#
# VIM #
#+++++++++#
vim_wrapper() {
mkdir -p "$dotfiles_path"/vim/.vim/{autoload,bundle,backup,swap}
echo "Cloning Vundle..."
git clone https://github.com/gmarik/Vundle.vim.git vim/.vim/bundle/Vundle.vim
stow -v vim
echo "To install the plugins run, inside of vim, :VundleUpdate"
}
#+++++++++#
# ANTIGEN #
#+++++++++#
antigen_wrapper() {
mkdir -p "$dotfiles_path"/antigen/.antigen
echo "Cloning antigen..."
git clone https://github.com/zsh-users/antigen.git antigen/.antigen
stow -v antigen
}
#+++++++++#
# MAIN #
#+++++++++#
if [[ ! -x /usr/bin/stow ]] && [[ ! -x /bin/stow ]]; then
echo "This script needs stow, please install it with your package manager of preference"
exit
elif [[ $1 == "--deploy" ]]; then
stow -v git zsh
vim_wrapper
antigen_wrapper
elif [[ $1 == "--conclude" ]]; then
stow -v --delete git zsh vim antigen
# What to do for when we want to deploy vim
elif [[ $1 == "--vim" ]]; then
vim_wrapper
# What to do for when we want to deploy antigen
elif [[ $1 == "--antigen" ]]; then
antigen_wrapper
# Display the help
else
print_help
fi