diff options
| author | Hayden Hamilton <hayden@hhvn.uk> | 2026-09-14 21:55:32 +0100 |
|---|---|---|
| committer | Hayden Hamilton <hayden@hhvn.uk> | 2026-09-14 21:55:32 +0100 |
| commit | a9747ebdb1bb7b73cfde20635a86345136ba86d8 (patch) | |
| tree | 2b7e4dd496cc943d25b57547d1763a8e72fd43ea | |
| parent | 16ae1dc465dc2936de8588d617eda9e02e7e84aa (diff) | |
| -rwxr-xr-x | hhvn.uk/repo/gitautoremote | 22 |
1 files changed, 22 insertions, 0 deletions
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 +} |