added directory parameter.
[feisty_meow.git] / scripts / rev_control / update_these.sh
1 #!/bin/bash
2 # a simple script for updating a set of folders on a usb stick from subversion or git.
3 #  currently
4 # just runs with no parameters and expects to get all archives from wherever the files originally
5 # came from.
6
7 dir="$1"; shift
8 if [ -z "$dir" ]; then
9   dir=.
10 fi
11
12 pushd "$dir"
13
14 for i in * ; do
15   if [ -d "$i" ]; then
16     pushd $i
17     # only update if we see a repository living there.
18     if [ -d ".svn" ]; then
19       svn update .
20     elif [ -d ".git" ]; then
21       git pull 
22     elif [ -d "CVS" ]; then
23       cvs update .
24     fi
25     popd
26   fi
27 done
28
29 popd
30
31