From 8fa7c7cb1d3c61e6cb0b801aca419bd752e04173 Mon Sep 17 00:00:00 2001 From: acidvegas Date: Tue, 27 Jun 2023 20:52:36 -0400 Subject: [PATCH] Added a git-shells-command helper --- assets/repo | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 assets/repo diff --git a/assets/repo b/assets/repo new file mode 100755 index 0000000..bb585fe --- /dev/null +++ b/assets/repo @@ -0,0 +1,14 @@ +#!/bin/sh +# git-shell-commands helper for stagit - developed by acidvegas (https://git.acid.vegas/stagit) +[ ! "$#" = '1' ] && echo "invlid arguments (use -c or -d)" && exit 1 +if [ $1 = '-c' ]; then + [ -d $2.git ] && echo "repository already exists" && exit 1 + [ ! -f post-receive ] && "missing post-receive script" && exit 1 + mkdir $2.git && git init --bare $2.git + touch $2.git/git-daemon-export-ok + ln post-recieve $2.git/hooks/post-recieve + echo "git://git.acid.vegas/$1.git" > $2.git/url +elif [ $1 = '-d' ]; then + [ ! -d $2.git ] && echo "repository does not exist" && exit 1 + rm -rf $2.git +fi \ No newline at end of file