scripts

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

commit d5e29c9a5e62551cf0e62d39587f91c6e7b629f5
parent 72b254c7f51fcc78b25d00e343dbcc4657423c5c
Author: bsandro <email@bsandro.tech>
Date:   Thu, 19 Jan 2023 23:58:27 +0200

Regenerate html only for the repository that is being pushed into

Diffstat:
Mrepos/post-receive | 34+++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/repos/post-receive b/repos/post-receive @@ -4,26 +4,26 @@ path_repos=/home/git/repos path_html=/var/www/htdocs/git site_url="https://bsandro.tech/git" pub_repos="${path_repos}/pub.txt" +cur_dir=`dirname $0` +cur_dir_path=`realpath $cur_dir` +repo_name=`dirname $cur_dir_path` cd "${path_repos}" stagit-index $(cat "${pub_repos}") > "${path_html}/index.html" +r=$(basename "${repo_name}") +d=$(basename "${repo_name}" ".git") cd "${path_html}" -for repo in $(cat "${pub_repos}"); do - r=$(basename "${repo}") - d=$(basename "${repo}" ".git") - cd "${path_html}" - printf "%s: " "${d}" - if [ ! -d "./${d}" ]; then - mkdir "./${d}" - fi - cd "./${d}" || continue - stagit -u "${site_url}/${d}/" "${path_repos}/${r}" - ln -sf ../style.css - ln -sf ../logo.png - ln -sf ../favicon.ico - ln -sf ../favicon.ico favicon.png - ln -sf log.html index.html +printf "%s: " "${d}" +if [ ! -d "./${d}" ]; then + mkdir "./${d}" +fi +cd "./${d}" || continue +stagit -u "${site_url}/${d}/" "${path_repos}/${r}" +ln -sf ../style.css +ln -sf ../logo.png +ln -sf ../favicon.ico +ln -sf ../favicon.ico favicon.png +ln -sf log.html index.html - echo "ok" -done +echo "ok"