Skip to content

Commit

Permalink
making the installer also serve as updater & do so gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
spf13 committed Sep 27, 2012
1 parent 475b816 commit 2a0cd04
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions bootstrap.sh
Expand Up @@ -11,23 +11,33 @@ die() {
exit 1
}

echo "thanks for installing spf13-vim\n"
function lnif {
if [ ! -e $2 ] ; then
ln -s $1 $2
fi
}

echo "Thanks for installing spf13-vim\n"

# Backup existing .vim stuff
echo "backing up current vim config\n"
today=`date +%Y%m%d`
for i in $HOME/.vim $HOME/.vimrc $HOME/.gvimrc; do [ -e $i ] && [ ! -L $file ] && mv $i $i.$today; done


echo "cloning spf13-vim\n"
git clone --recursive -b 3.0 http://github.com/spf13/spf13-vim.git $endpath
mkdir -p $endpath/.vim/bundle
ln -s $endpath/.vimrc $HOME/.vimrc
ln -s $endpath/.vimrc.bundles $HOME/.vimrc.bundles
ln -s $endpath/.vim $HOME/.vim

echo "Installing Vundle"
git clone http://github.com/gmarik/vundle.git $HOME/.vim/bundle/vundle
lnif $endpath/.vimrc $HOME/.vimrc
lnif $endpath/.vimrc.bundles $HOME/.vimrc.bundles
lnif $endpath/.vim $HOME/.vim

if [ ! -d $endpath ]; then
echo "cloning spf13-vim\n"
git clone --recursive -b 3.0 http://github.com/spf13/spf13-vim.git $endpath
echo "Installing Vundle"
git clone http://github.com/gmarik/vundle.git $HOME/.vim/bundle/vundle
else
echo "updating spf13-vim\n"
cd $endpath && git pull
fi

echo "installing plugins using Vundle"
vim -u $endpath/.vimrc.bundles - +BundleInstall! +BundleClean +qall

0 comments on commit 2a0cd04

Please sign in to comment.