Created
February 17, 2010 10:40
-
-
Save romac/306498 to your computer and use it in GitHub Desktop.
This simple bash script update all the working copies in the current folder. Handle Git and Subversion.
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
#!/usr/bin/env bash | |
cd "$1"; | |
PATH=`pwd`; | |
SVN_FOLDER=".svn" | |
SVN_BIN="/opt/local/bin/svn" | |
GIT_FOLDER=".git" | |
GIT_BIN="/opt/local/bin/git" | |
echo "In $PATH :"; | |
for REPOSITORY in "$PATH"/*; | |
do | |
if [[ -d $REPOSITORY ]] | |
then | |
if [[ -f $REPOSITORY/SKIP_REPO ]] | |
then | |
continue; | |
fi | |
cd "$REPOSITORY"; | |
echo -n Updating `/usr/bin/basename "$REPOSITORY"`...; | |
if [[ -d $REPOSITORY/$SVN_FOLDER ]] | |
then | |
echo " [Subversion]"; | |
$SVN_BIN update; | |
fi | |
if [[ -d $REPOSITORY/$GIT_FOLDER ]] | |
then | |
echo " [Git]"; | |
$GIT_BIN pull; | |
fi | |
echo ""; | |
cd "$PATH"; | |
fi | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment