X-Git-Url: https://git.armaanb.net/?a=blobdiff_plain;f=git-mirror;h=6d3f00cad6a7e6810d7b72deefd9834796909630;hb=55a218e51cd587265c04508f816b8b2fff56840e;hp=23a89407c03d69f3ee042acfa9fc5ae96858e8ad;hpb=9b39d66913fc4a23f2b2a0b3f98df54f729ab360;p=bin.git diff --git a/git-mirror b/git-mirror index 23a8940..6d3f00c 100755 --- a/git-mirror +++ b/git-mirror @@ -4,6 +4,7 @@ usage() { 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 git-mirror help -- show this message @@ -19,15 +20,18 @@ run() { cd ${1} [ -d ${3} ] || mkdir ${3} - cd ${3} && stagit-index ${1}/* + 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 @@ -37,7 +41,7 @@ run() { echo $(date -Iseconds) ' | ' ${dir} | tee -a ${2} echo $(tail -n 1500 ${2}) > ${2} done - sleep 600 + sleep ${4:-600} done }