aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmake_repo.py2
-rwxr-xr-xpost-receive-hook.sh3
2 files changed, 5 insertions, 0 deletions
diff --git a/make_repo.py b/make_repo.py
index ea585c2..f40ed9a 100755
--- a/make_repo.py
+++ b/make_repo.py
@@ -62,6 +62,8 @@ with ChangeCWD(repo_dir):
with open(os.path.join(repo_dir, "config"), "a") as f:
f.write("[gitweb]\n\towner = %s <%s>" % (author, author_email))
+subprocess.run(["ln", "-s", os.path.join(os.path.dirname(conf_path), "post-receive-hook.sh"), os.path.join(repo_dir, "hooks", "post-receive")])
+
if input("Would you like the repository to remain bare? Useful for making mirrors of Github repos. <y/n>: ").lower() != "y":
with tempfile.TemporaryDirectory() as tempdir:
subprocess.run(["git", "clone", repo_url, tempdir])
diff --git a/post-receive-hook.sh b/post-receive-hook.sh
new file mode 100755
index 0000000..1b56595
--- /dev/null
+++ b/post-receive-hook.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+echo "Push successful!" \ No newline at end of file