From bef683ad42e399e8950bff1928c100e4984c4b74 Mon Sep 17 00:00:00 2001 From: mivirl <> Date: Sun, 24 Sep 2023 04:25:09 +0000 Subject: [PATCH] Use here-doc for readme generation hook --- create-repo | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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" -- 2.39.5