-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.sh
executable file
·50 lines (42 loc) · 1.29 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
#!/bin/bash
shopt -s dotglob nullglob
ZSH='/usr/local/bin/zsh'
REPO_PREZTO='https://github.com/sorin-ionescu/prezto.git'
REPO_VUNDLE='https://github.com/gmarik/Vundle.vim.git'
# Resolve dependency: Zsh
if [ ! -f $ZSH ] ; then
if [[ "$OSTYPE" = "darwin"* ]] && type brew > /dev/null ; then
brew install zsh
echo $ZSH | sudo tee -a /etc/shells
if [ -f $ZSH ] ; then
chsh -s $ZSH
else
echo "Installation failed."
exit 1
fi
else
echo "Zsh requires manual install."
fi
fi
# Resolve dependency: Prezto
if [ ! -d "${HOME}/.zprezto" ] ; then
git clone --recursive $REPO_PREZTO "${HOME}/.zprezto"
rm "${HOME}/.zprezto/runcoms/README.md"
zsh -c 'setopt EXTENDED_GLOB; for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/* ; do ; ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" ; done'
git pull && git submodule update --init --recursive
fi
# Copy config files to home directory
for i in * ; do
if [[ $i != '.git' ]] && [[ $i != '.gitignore' ]] && [[ $i == .* ]] ; then
rm -rf "${HOME}/${i}"
cp -R $i "${HOME}/${i}"
fi
done
# Resolve dependency: Vundle
if [ ! -f "${HOME}/.vim/bundle/Vundle.vim" ] ; then
git clone $REPO_VUNDLE ~/.vim/bundle/Vundle.vim
fi
# Install Vim plugins via Vundle
vim +PluginInstall +qall
echo "Installation complete."
exit 0