diff options
Diffstat (limited to 'hhvn.uk')
| -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 +} |