From: mivirl <> Date: Sun, 24 Sep 2023 04:25:09 +0000 (+0000) Subject: Use here-doc for readme generation hook X-Git-Url: http://mivirl.dev/git/?a=commitdiff_plain;h=bef683ad42e399e8950bff1928c100e4984c4b74;p=git-shell-commands.git Use here-doc for readme generation hook --- diff --git a/create-repo b/create-repo index b0fa26f..f70ea27 100755 --- a/create-repo +++ b/create-repo @@ -13,11 +13,14 @@ if [ -d "/srv/git/$REPO" ]; then fi cd /srv/git -mkdir "$REPO" -cd "$REPO" +mkdir "$REPO" && cd "$REPO" git init --bare -echo "#!/bin/sh" >> hooks/post-receive -echo 'git cat-file blob HEAD:README.md | markdown > $GIT_DIR/README.html' >> hooks/post-receive + +cat << EOF > hooks/post-receive +#!/bin/sh +git cat-file blob HEAD:README.md | markdown > $GIT_DIR/README.html +EOF + chmod +x hooks/post-receive touch git-daemon-export-ok echo "Created $REPO"