git-scripts

Scripts for managing (sta-)git repos
git clone git://git.christianermann.dev/git-scripts
Log | Files | Refs | LICENSE

repo-index.sh (529B)


      1 #! /bin/sh
      2 
      3 set -eu
      4 
      5 CONFIG_PATH="/home/git/config.rc"
      6 . "${CONFIG_PATH}"
      7 
      8 # Build a list of all public repos. This is denoted by the existence of a
      9 # file named `git-daemon-export-ok`.
     10 repos=""
     11 repos_stripped=""
     12 for repo in "${GIT_ROOT}"/*; do
     13     if [ -f "${repo}/git-daemon-export-ok" ]; then
     14 	repo_stripped="${repo#"$GIT_ROOT/"}"
     15 	repos="$repo $repos"
     16 	repos_stripped="${repo_stripped} $repos_stripped"
     17     fi
     18 done
     19 
     20 # Build 'repos' page.
     21 cd "${WWW_ROOT}" || exit 1
     22 stagit-index $repos > index.html
     23 cp "${CSS_PATH}" style.css