oshgit

Shell scripts based on stagit to manage OSHs git repositories.
git clone git://git.oshgnacknak.de/oshgit.git
Log | Files | Refs | README

commit 898664d7b393e05588c99d7e7837048b70aef684
parent 28d9eb606251f46e6561456dad9b8b28993bc2f4
Author: Oshgnacknak <osh@oshgnacknak.de>
Date:   Sun, 25 Oct 2020 14:39:47 +0100

Support older git versions without -C

Diffstat:
Mbuild.sh | 22+++++++++++-----------
Mnew-repo.sh | 23+++++++++++++----------
2 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/build.sh b/build.sh @@ -22,21 +22,21 @@ cp $here/logo.png $output/logo.png ln -sf $output/logo.png $output/favicon.png for repo in ${@:-$repos}; do - dir="$output/$(basename $repo .git)" - repo=$(realpath $repo) + dir="$output/$(basename $repo .git)" + repo=$(realpath $repo) - mkdir -p $dir - pushd $dir + mkdir -p $dir + pushd $dir - echo Building html for $repo to $dir - stagit -c ".cache" $repo + echo Building html for $repo to $dir + stagit -c ".cache" $repo - ln -sf log.html index.html - ln -sf $output/style.css style.css - ln -sf $output/logo.png logo.png - ln -sf $output/logo.png favicon.png + ln -sf log.html index.html + ln -sf $output/style.css style.css + ln -sf $output/logo.png logo.png + ln -sf $output/logo.png favicon.png - popd + popd done chgrp www-data $output -R diff --git a/new-repo.sh b/new-repo.sh @@ -5,17 +5,20 @@ set -e cd $(dirname $0) for name in $@; do - dir="../$name.git" - url="ssh://osh@192.168.2.6:/~/git/$name.git" + dir="../$name.git" + url="ssh://osh@192.168.2.6:/~/git/$name.git" - mkdir $dir - git -C $dir init --bare + mkdir $dir + pushd $dir + git init --bare + popd - echo "Oshgnacknak" > $dir/owner - echo $url > $dir/url - ${EDITOR:-vi} $dir/description - ln -sr post-receive.sh $dir/hooks/post-receive - ./build.sh $dir - echo "Clone: $url" + echo "Oshgnacknak" > $dir/owner + echo $url > $dir/url + ${EDITOR:-vi} $dir/description + ln -sr post-receive.sh $dir/hooks/post-receive + + ./build.sh $dir + echo "Clone: $url" done