commit b0817ef7b54d6f0b143af83fde5a1f89a7f20c93 parent 4ecde10cad073f2aebe1b4ece9743507e48b87f5 Author: andersuno <anders@desk.andersuno.nu> Date: Sat, 7 May 2022 20:13:50 +0200 Extended new-repo Diffstat:
M | git-shell-commands/new-repo | | | 16 | +++++++++++++++- |
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/git-shell-commands/new-repo b/git-shell-commands/new-repo @@ -1,6 +1,20 @@ #!/bin/sh -[[ -z $1 ]] && echo "No name provided" && exit 1 +[ -z $1 ] && echo "No name provided" && echo "new-repo <name> <desc>" && exit 1 +[ -z $2 ] && echo "No description provided" && echo "new-repo <name> <desc>" && exit 1 + mkdir -p /git-server/repos/$1.git cd /git-server/repos/$1.git git init --bare touch git-daemon-export-ok +echo "$2" > ./description +echo "git.andersuno.nu/$1.git" > ./url +echo "andersuno" > ./owner +echo "cd /git-server/public-html/$1 && stagit /git-server/repos/$1.git" > ./hooks/post-update +echo "find /git-server/repos/ -type d -name \*.git | sort | xargs stagit-index > /git-server/public-html/index.html" >> ./hooks/post-update +chmod +x ./hooks/post-update + +mkdir -p /git-server/public-html/$1 +cd /git-server/public-html/$1 +ln -sf ../favicon.png favicon.png +ln -sf ../logo.png logo.png +ln -sf ../style.css style.css