]> _ Git - git-shell-commands.git/commitdiff
Use here-doc for readme generation hook
authormivirl <>
Sun, 24 Sep 2023 04:25:09 +0000 (04:25 +0000)
committermivirl <>
Sun, 24 Sep 2023 04:25:09 +0000 (04:25 +0000)
create-repo

index b0fa26f38b8f1db5472fba714a47ef693b70603d..f70ea27cf475cca7535a9392602d6dfde1266eff 100755 (executable)
@@ -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"