]> git.armaanb.net Git - bin.git/blobdiff - git-mirror
Fix indentation on all programs
[bin.git] / git-mirror
index 6d3f00cad6a7e6810d7b72deefd9834796909630..a6eaa6b8b84bcbec73d7fe1e220280da70d3f4b0 100755 (executable)
@@ -2,7 +2,7 @@
 # Mirror some Git repos
 
 usage() {
-  echo 'Usage: git-mirror [command] [arguments]
+               echo 'Usage: git-mirror [command] [arguments]
   git-mirror run [path to repos] [path to log file] [html directory]
       optional: [sleep duration]
   git-mirror gen-url [path to repo] -- generate url file in repo
@@ -13,59 +13,59 @@ 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
+               [ -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}
+               cd ${1}
 
-  [ -d ${3} ] || mkdir ${3}
-  cd ${3}
+               [ -d ${3} ] || mkdir ${3}
+               cd ${3}
 
-  while :; do
-    stagit-index ${1}/*
-    find "$1" -name '*.git' -type d | \
-      while read dir; do
-        newdir=${3}/$(basename ${dir} .git)
-        [ -d ${newdir} ] || mkdir ${newdir}
-        cd ${newdir}
-        stagit ${dir}
-        cp "$1/logo.png" .
-        ln -s logo.png favicon.png
-        find . -type f \( -name '*.html' -or -name '*.xml' \) | \
-          while read i ; do
-            minify ${i} > ${i}.tmp
-            mv ${i}.tmp ${i}
-          done
-          git -C ${dir} fetch --tags
-          echo $(date -Iseconds) ' | ' ${dir} | tee -a ${2}
-          echo $(tail -n 1500 ${2}) > ${2}
-        done
+               while :; do
+                               stagit-index ${1}/*
+                               find "$1" -name '*.git' -type d | \
+                                               while read dir; do
+                                                               newdir=${3}/$(basename ${dir} .git)
+                                                               [ -d ${newdir} ] || mkdir ${newdir}
+                                                               cd ${newdir}
+                                                               stagit ${dir}
+                                                               cp "$1/logo.png" .
+                                                               ln -s logo.png favicon.png
+                                                               find . -type f \( -name '*.html' -or -name '*.xml' \) | \
+                                                                               while read i ; do
+                                                                                               minify ${i} > ${i}.tmp
+                                                                                               mv ${i}.tmp ${i}
+                                                                               done
+                                                               git -C ${dir} fetch --tags
+                                                               echo $(date -Iseconds) ' | ' ${dir} | tee -a ${2}
+                                                               echo $(tail -n 1500 ${2}) > ${2}
+                                               done
         sleep ${4:-600}
-      done
-    }
+    done
+}
 
-  gen_url() {
+gen_url() {
     find ${1} -maxdepth 2 -name '*.git' | \
-      while read dir; do
-        $(git -C $dir remote get-url origin) > $dir/url
-      done
-    }
+                               while read dir; do
+                                               $(git -C $dir remote get-url origin) > $dir/url
+                               done
+}
 
-  case ${1} in
+case ${1} in
     -h | --help | help)
-      usage
-      ;;
+                               usage
+                               ;;
     run)
-      shift 1
-      run $@
-      ;;
+                               shift 1
+                               run $@
+                               ;;
     gen-url)
-      shift 1
-      gen_url $@
-      ;;
+                               shift 1
+                               gen_url $@
+                               ;;
     *)
-      usage
-      exit 1
-      ;;
-  esac
+                               usage
+                               exit 1
+                               ;;
+esac