From a9747ebdb1bb7b73cfde20635a86345136ba86d8 Mon Sep 17 00:00:00 2001 From: Hayden Hamilton Date: Mon, 14 Sep 2026 21:55:32 +0100 Subject: script to automatically create repo, and set git remote --- hhvn.uk/repo/gitautoremote | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 hhvn.uk/repo/gitautoremote (limited to 'hhvn.uk/repo/gitautoremote') diff --git a/hhvn.uk/repo/gitautoremote b/hhvn.uk/repo/gitautoremote new file mode 100755 index 0000000..cf489e8 --- /dev/null +++ b/hhvn.uk/repo/gitautoremote @@ -0,0 +1,22 @@ +#!/bin/rc + +repodir = `$nl{git rev-parse --show-toplevel} +if (!~ $status 0) { + exit $status +} + +reponame = `$nl{basename $repodir} + +cmds = `$nl{hhvn.uk/repo/mkrepo $reponame} +# ignore $status here, as it will fail if repo +# already exists, but we still want those cmds... + +# instead, use this sanity check to check for failure +if (!~ `{echo $cmds | grep -Eo '^git| git ' | wc -l} 2) { + exit 1 +} + +for (cmd in $cmds) { + echo RC -c $^cmd + rc -c $^cmd +} -- cgit v1.2.3