pile

Not quite a web "stack"; more orderly than a web "heap", hopefully?
git clone https://git.kevinlegouguec.net/pile
Log | Files | Refs

post-receive (693B)


      1 #!/bin/bash
      2 
      3 set -eu
      4 
      5 declare -r SCRIPTS_DIR=$(dirname "$(realpath "$0")")
      6 . "${SCRIPTS_DIR}"/settings
      7 . "${SCRIPTS_DIR}"/tools.env
      8 
      9 declare -r WWW_REPO_DIR=$(git remote get-url www)
     10 
     11 v () ( set -x ; "$@" )
     12 
     13 # TODO: Replace --mirror with refs/heads/* refs/tags/*?
     14 # --mirror pushes refs/remotes/www/* too, so www records goofy www/*
     15 # refs that are one push late.
     16 # (Ideally would use --branches --tags, but seem mutually exclusive)
     17 v git push --force --mirror www
     18 
     19 cd "${WWW_REPO_DIR}"
     20 v git update-server-info
     21 v stagit "${PWD}"
     22 
     23 cd ..
     24 # TODO bash≥4.4: readarray -d '' < <(dirname -z */HEAD)
     25 v find -name HEAD -exec dirname -z '{}' '+' | sort -z |
     26     v xargs -t0 stagit-index > index.html