stagit-scripts

Personal companion scripts for stagit
git clone _git@git.zakaria.org/stagit-scripts.git
Log | Files | Refs | README

post-receive (606B)


      1 #!/bin/sh
      2 # Author: Cale "poptart" Black
      3 # Modified by: zakaria @ zakaria.org
      4 # License: MIT
      5 
      6 set -euf
      7 
      8 . /var/git/config.rc
      9 
     10 export LC_TYPE="en_US.UTF-8"
     11 src="$(pwd)"
     12 name="$(basename "$src")"
     13 dest="${WWW_HOME}/$(basename "$name" '.git')"
     14 mkdir -p "$dest"
     15 cd "$dest" || exit 1
     16 
     17 echo "[stagit] building $dest"
     18 /usr/local/bin/stagit "$src"
     19 
     20 echo "[stagit] linking $dest"
     21 # if a README.html exists use that as the index.html
     22 # if not use log.html
     23 if [ -f "README.html" ]; then
     24     ln -sf README.html index.html
     25 else
     26     ln -sf log.html index.html
     27 fi
     28 ln -sf ../style.css style.css
     29 ln -sf ../logo.png logo.png