Last Updated: February 25, 2016
·
391
· hoffoo

Mass update repositories script

Like many vim pathogen users, I have a ton of plugins in .vim/bundle, all from
various repos. I use the following script to update them all at once:

#!/bin/bash

# update pathogen .vim/bundle repositories

BACK=$(pwd)

update() {
    cd $1

    if [ -d ".git" ]; then
        git pull origin master
    elif [ -d ".hg" ]; then
        hg pull
    elif [ -d ".svn" ]; then
        svn update
    fi

    cd $BACK
}

for plugin in $(ls --color=never | xargs);
do
    update $plugin
done