drist

collection of scripts for use with drist
git clone git://git.pyratebeard.net/drist.git
Log | Files | Refs | README

stagitdo (784B)


      1 #!/bin/sh
      2 
      3 REPOSDIR="/srv/git"
      4 WWWBASE="/var/www/html"
      5 BASEURL="https://git.pyratebeard.net"
      6 
      7 for repo in "${REPOSDIR}/"*/ ; do
      8 	# strip .git suffix
      9 	r=$(basename "${repo}")
     10 	d=$(basename "${repo}" ".git")
     11 	printf "%s... " "${d}"
     12 	
     13 	sudo mkdir -p "${WWWBASE}/${d}"
     14 	cd "${WWWBASE}/${d}" || continue
     15 	sudo stagit -c ".cache" -u "${BASEURL}/$d/" "${REPOSDIR}/${r}"
     16 	
     17 	# symlinks
     18 	sudo ln -sf log.html index.html
     19 	sudo ln -sf ../style.css style.css
     20 	sudo ln -sf ../logo.png logo.png
     21 	sudo ln -sf ../favicon.png favicon.png
     22 
     23 	# this is a little hack to remove the
     24 	# border from icon link
     25 	for f in $(find . -type f -name "*.html") ; do
     26 		sudo sed -i 's%href=".*/"%href="/"\ style="border:\ 0px;"%' "${f}"
     27 	done
     28 done
     29 
     30 sudo stagit-index "${REPOSDIR}/"*/ | sudo tee "${WWWBASE}/index.html"