X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Frev_control%2Fupdate_these.sh;h=b0cc4b8aad25980d7b2febca1a12cc79fa7eac93;hb=1a36c2a572972cf95f00bb84c32a51b5693ccb1a;hp=bd7b1c1f18563d29fffbceaac3bbe8ce52344186;hpb=2952ccf47b80174880141a7ecfa122089f349b8d;p=feisty_meow.git diff --git a/scripts/rev_control/update_these.sh b/scripts/rev_control/update_these.sh index bd7b1c1f..b0cc4b8a 100644 --- a/scripts/rev_control/update_these.sh +++ b/scripts/rev_control/update_these.sh @@ -1,14 +1,33 @@ #!/bin/bash -# a simple script for updating a set of folders on a usb stick from -# subversion. currently just runs with no parameters and expects to -# get all archives from wherever the files originally came from. +# a simple script for updating a set of folders on a usb stick from subversion or git. +# currently +# just runs with no parameters and expects to get all archives from wherever the files originally +# came from. + +dir="$1"; shift +if [ -z "$dir" ]; then + dir=. +fi + +pushd "$dir" &>/dev/null + for i in * ; do if [ -d "$i" ]; then - pushd $i + echo "[$i]" + pushd $i &>/dev/null + # only update if we see a repository living there. if [ -d ".svn" ]; then - # only update if we see a repository living here. svn update . + elif [ -d ".git" ]; then + git pull + elif [ -d "CVS" ]; then + cvs update . fi - popd + popd &>/dev/null + echo "=======" fi done + +popd &>/dev/null + +