Created
June 27, 2010 17:31
-
-
Save valpackett/455038 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Small script that updates version controlled subdirs. | |
# Awesome for your django apps or jquery plugins collection. | |
# By myfreeweb <[email protected]> | |
# Licensed under Do The Fuck What You Want License. | |
upd_tmpl="Updating with"; | |
find_opts="-maxdepth 1 -mindepth 1 -type d"; | |
root=`pwd`/; | |
for dir in `find . $find_opts`; do | |
abs_dir=$root$(basename $dir); | |
for subdir in `find $abs_dir/ $find_opts`; do | |
cd $abs_dir; | |
case $(basename $subdir) in | |
'.bzr') | |
echo "$upd_tmpl bzr: $subdir"; | |
bzr pull | |
;; | |
'.git') | |
echo "$upd_tmpl git: $subdir"; | |
git pull | |
;; | |
'.hg') | |
echo "$upd_tmpl hg: $subdir"; | |
hg pull; | |
hg update | |
;; | |
'.svn') | |
echo "$upd_tmpl svn: $subdir"; | |
svn up | |
;; | |
esac | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment