From 42ad3d7dd98f3b56513f65dd8ee0a957659c6109 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Tue, 9 Jun 2015 22:06:42 -0400 Subject: Import required submodules. --- bin/setup.sh | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/bin/setup.sh b/bin/setup.sh index 4921bcf..7bca3e7 100755 --- a/bin/setup.sh +++ b/bin/setup.sh @@ -12,6 +12,16 @@ if [[ ! -f dotfiles/bin/setup.sh ]]; then exit 1 fi +if ! which git >/dev/null; then + echo -e "${red}[FAIL]${none} git not installed" + exit 1 +fi + +cd ~/dotfiles +git submodule update --recursive +git submodule foreach pull + +cd # Creates a symlink with target $1 at location $2. # Does nothing and prints an error message if $2 exists and is not a symlink. create_symlink() { @@ -47,21 +57,17 @@ else fi create_symlink dotfiles/vimrc .vimrc -if which git >/dev/null; then - if [[ -e .vim/bundle/Vundle.vim ]]; then - echo -e "${orange}[SKIPPED]${none} Vundle.vim already installed" +if [[ -e .vim/bundle/Vundle.vim ]]; then + echo -e "${orange}[SKIPPED]${none} Vundle.vim already installed" +else + success=1 + mkdir -p .vim/bundle + git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim \ + || success=0 + vim +PluginInstall +qall || success=0 + if [[ "$success" == "1" ]]; then + echo -e "${green}[OK]${none} installed vim plugins" else - success=1 - mkdir -p .vim/bundle - git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim \ - || success=0 - vim +PluginInstall +qall || success=0 - if [[ "$success" == "1" ]]; then - echo -e "${green}[OK]${none} installed vim plugins" - else - echo -e "${red}[WARNING]${none} failed to install vim plugins" - fi + echo -e "${red}[WARNING]${none} failed to install vim plugins" fi -else - echo -e "${red}[WARNING]${none} git not installed" fi -- cgit v1.2.3