scripts

Assortment of various scripts and helpers.
git clone git://bsandro.tech/scripts
Log | Files | Refs | README | LICENSE

post-receive (668B)


      1 #!/bin/sh
      2 
      3 path_repos=/home/git/repos
      4 path_html=/var/www/htdocs/git
      5 site_url="https://bsandro.tech/git"
      6 pub_repos="${path_repos}/pub.txt"
      7 cur_dir=`dirname $0`
      8 cur_dir_path=`realpath $cur_dir`
      9 repo_name=`dirname $cur_dir_path`
     10 
     11 cd "${path_repos}"
     12 stagit-index $(cat "${pub_repos}") > "${path_html}/index.html"
     13 
     14 r=$(basename "${repo_name}")
     15 d=$(basename "${repo_name}" ".git")
     16 cd "${path_html}"
     17 printf "%s: " "${d}"
     18 if [ ! -d "./${d}" ]; then
     19 	mkdir "./${d}"
     20 fi
     21 cd "./${d}" || continue
     22 stagit -u "${site_url}/${d}/" "${path_repos}/${r}"
     23 ln -sf ../style.css
     24 ln -sf ../logo.png
     25 ln -sf ../favicon.ico
     26 ln -sf ../favicon.ico favicon.png
     27 ln -sf log.html index.html
     28 
     29 echo "ok"