]> git.armaanb.net Git - bin.git/blobdiff - git-mirror
fmt-music: add script
[bin.git] / git-mirror
index 3253b90a4b843605ff9426f2734921d54904c811..6457db6c27eeb29bc672bcff33aa5f1db3f240c8 100755 (executable)
@@ -14,20 +14,25 @@ usage() {
 run() {
   [ -z ${3} ] && echo "not enough arguments" && exit 1
   [ -z $(which stagit) ] && echo "please install stagit" && exit 1
+  [ -z $(which minify) ] && echo "please install minify" && exit 1
 
   cd ${1}
 
   [ -d ${3} ] || mkdir ${3}
-  stagit-index ./* > ${3}/index.html
+  cd ${3} && stagit-index
   cp /usr/share/doc/stagit/style.css ${3}
 
   while :; do
-    find ${1} -maxdepth 2 -name '*.git' | \
-      while read dir; do
+      for dir in "${1}/*.git"; do
         newdir=${3}/$(basename ${dir} .git)
         [ -d ${newdir} ] || mkdir ${newdir}
         cd ${newdir}
         stagit ${dir}
+        find . -type f \( -name '*.html' -or -name '*.xml' \) | \
+          while read i ; do
+            minify ${i} > ${i}.tmp
+            mv ${i}.tmp ${i}
+          done
         cp /usr/share/doc/stagit/style.css .
         git -C ${dir} fetch --tags
         echo $(date -Iseconds) ' | ' ${dir} | tee -a ${2}