grm

git repo manager for self-hosted git servers
git clone git://sink.krj.st/grm
Log | Files | Refs | README | LICENSE

commit 04081a7fe210cd42eb9a865b28cbd8a52d4af16d
parent bf984ddb645e8a4da3106cf7ab3d11832c71d63d
Author: krasjet <nil@krj.st>
Date:   Mon, 13 Jul 2020 06:14:47 -0700

rc: more error handling

Diffstat:
Mgrm | 14++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/grm b/grm @@ -39,14 +39,12 @@ recompile_repo() { [ -d "$repo_dir" ] || { echo "[$1] repo not found"; return 1; } mkdir -p "$repo_web_dir" - cd "${repo_web_dir:?}" || return 1; - - rm -f "$cachefile" - rm -rf "commit" - - stagit -c "$cachefile" "$repo_dir" - ln -sf log.html index.html + cd "${repo_web_dir:?}" && \ + rm -f "$cachefile" && \ + rm -rf "commit" && \ + stagit -c "$cachefile" "$repo_dir" && \ + ln -sf log.html index.html && \ echo "[$1] done!" } @@ -62,7 +60,7 @@ rebuild_index() { -type d -name "*.git" \ -exec test -e "{}/git-daemon-export-ok" \;\ -print | \ - sort | xargs stagit-index > "${web_root}/index.html" + sort | xargs stagit-index > "${web_root}/index.html" && \ echo "[index] done!" }