diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2025-10-15 18:38:33 -0400 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-10-15 18:38:33 -0400 |
commit | 8f4e7304e6be91a45300f813faa9ffb9c7436144 (patch) | |
tree | 6282c8c8f5fb2f2a14b62cd7c4bdd3f3ecc5f93d | |
parent | 428761f1db5fbdc171a60188bce7eda03d4f63bf (diff) |
-rwxr-xr-x | help | 1 | ||||
-rwxr-xr-x | init | 4 | ||||
-rwxr-xr-x | setup-receive-hook | 30 | ||||
-rwxr-xr-x | setup-receive-hooks (renamed from setup-recieve-hooks) | 0 |
4 files changed, 33 insertions, 2 deletions
@@ -12,5 +12,6 @@ unignore <name> bash clone-all-github setup-receive-hooks +setup-receive-hook <name> setup-remote <name> <remote_name> <remote> """ @@ -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 |