summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xhelp1
-rwxr-xr-xinit4
-rwxr-xr-xsetup-receive-hook30
-rwxr-xr-xsetup-receive-hooks (renamed from setup-recieve-hooks)0
4 files changed, 33 insertions, 2 deletions
diff --git a/help b/help
index 2171cee..ebb1d82 100755
--- a/help
+++ b/help
@@ -12,5 +12,6 @@ unignore <name>
bash
clone-all-github
setup-receive-hooks
+setup-receive-hook <name>
setup-remote <name> <remote_name> <remote>
"""
diff --git a/init b/init
index 61605c0..8f82adb 100755
--- a/init
+++ b/init
@@ -27,5 +27,5 @@ mkdir "$new_repo"
git init --bare "$new_repo" >/dev/null 2>&1\
&& echo "Initialized empty Git repository: git@$(uname -n):$1"
-echo 'git push github -f --mirror' > "$new_repo/hooks/post-receive"
-chmod +x "$new_repo/hooks/post-receive"
+# echo 'git push github -f --mirror' > "$new_repo/hooks/post-receive"
+# chmod +x "$new_repo/hooks/post-receive"
diff --git a/setup-receive-hook b/setup-receive-hook
new file mode 100755
index 0000000..4fd25b4
--- /dev/null
+++ b/setup-receive-hook
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+
+if [ $# -ne 1 ]; then
+ echo "usage: setup-receive-hook <name>"
+ exit 1
+fi
+
+set -xe
+
+USER="compromyse"
+
+base_dir="$HOME"
+repo="${base_dir}/$1"
+
+case $repo in
+ *\.git)
+ ;;
+ *)
+ repo="${new_repo}.git"
+ ;;
+esac
+
+if [ ! -d "$repo" ]; then
+ echo "$repo does not exist"
+ exit 1
+fi
+
+cd $repo
+echo 'git push github -f --mirror' > "$new_repo/hooks/post-receive"
+chmod +x "$new_repo/hooks/post-receive"
diff --git a/setup-recieve-hooks b/setup-receive-hooks
index dbaad48..dbaad48 100755
--- a/setup-recieve-hooks
+++ b/setup-receive-hooks