Skip to content

Instantly share code, notes, and snippets.

@hoosteeno
Last active December 25, 2015 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoosteeno/6938196 to your computer and use it in GitHub Desktop.
Save hoosteeno/6938196 to your computer and use it in GitHub Desktop.
Bash script for outputting a CSV with information about the contents of the mozilla.com SVN tree.
#!/bin/bash
# depends on an up-to-date local copy of the mozilla.com svn tree!!
#cd ~/mozilla/mozilla.com; svn update; cd ~/mozilla/legacy
echo "LOCATION, SVN, # FILES, BUG, NEXT STEPS"
for FILE in `find ~/mozilla/mozilla.com/en-US \
-type d -name .svn -prune -o \
-type f -name *.html -print -o \
-type d -print`
do
SVN=`echo $FILE | perl -pe 's|^.*?com|http://viewvc.svn.mozilla.org/vc/projects/mozilla.com/trunk|'`
LOC=`echo $FILE | perl -pe 's|^.*?com|http://www.mozilla.com|'`
if [ -d $FILE ]
then
DIR=$FILE/
COUNT=`find $DIR -mindepth 1 -print | wc -l`
else
COUNT=''
LOC=" $LOC"
fi
#RESP=`http --headers $LOC | head -1`
#RESP=''
echo "$LOC, $SVN, $COUNT"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment