diff options
author | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2015-06-09 22:06:42 -0400 |
---|---|---|
committer | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2015-06-09 22:06:42 -0400 |
commit | 42ad3d7dd98f3b56513f65dd8ee0a957659c6109 (patch) | |
tree | f281b82806e14ecdbc8efac9477adefa0919cf78 /bin | |
parent | 6c496b9455999035343d117e5543d04c7c628db7 (diff) |
Import required submodules.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/setup.sh | 36 |
1 files 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 |