Created
April 24, 2014 20:16
-
-
Save sferich888/11268083 to your computer and use it in GitHub Desktop.
bash script to save a directory of repositories with 1 or two sub-directories in side them that are SVN repositories.
This file contains 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
DEBUG=TRUE | |
SAVE_FILE=/tmp/REPOS | |
REPO_DIR="$HOME/Repositories/" && cd $REPO_DIR | |
echo "Moved into Repository Directory: $(pwd)" | |
for repo in $(ls); do | |
echo "Saving: $repo" | |
cd $repo; git remote -v | grep -e push | awk '{print $2}' >> $SAVE_FILE | |
for cdir in $(ls -d */ | grep -v "\."); do | |
if [[ $DEBUG == "TRUE" ]]; then echo "Checking for SVN repos at $cdir"; fi | |
if [[ -e $cdir/.svn ]]; then | |
cd $cdir/ | |
echo -n "SVN:" >> $SAVE_FILE | |
svn info | grep 'URL: [sh]' | cut -d ':' -f 2,3 >> $SAVE_FILE | |
fi | |
done | |
echo >> $SAVE_FILE | |
cd $REPO_DIR | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment