-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinit.sh
executable file
·42 lines (32 loc) · 876 Bytes
/
init.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
#!/usr/bin/env bash
# Initial dotfile and soft-link setup
DOTFILES=(".vimrc" ".tmux.conf" ".zshrc")
VUNDLE_REPO="https://github.com/VundleVim/Vundle.vim.git"
VUNDLE_DIR="$HOME/.vim/bundle/Vundle.vim"
check_exists () {
if [[ -e "$1" ]]; then
echo "$1 already exists. Are you sure you need to init?"
exit 1
fi
}
install_vundle () {
if [[ -e "$VUNDLE_DIR" ]]; then
echo "Error: Vundle already exists."
exit 1
fi
git clone "$VUNDLE_REPO" "$VUNDLE_DIR" &&\
echo "Successfully installed Vundle"
}
setup () {
pushd "$HOME"
source_dir=$(dirname "${BASH_SOURCE[0]}")
#install_vundle || true
for file in "${DOTFILES[@]}"
do
check_exists "$HOME/$file" &&\
ln -s "$source_dir"/"$file" "$HOME/$file" &&\
echo "Successfully set up $file"
done
popd
}
setup