From 375c8da8d9ec99c2e62ebf4492b936f01e83393c Mon Sep 17 00:00:00 2001 From: Claudius 'keldu' Holeksa Date: Thu, 1 Aug 2024 13:57:53 +0200 Subject: changed to post-receive --- Makefile | 6 +++--- post-commit.tmpl | 15 --------------- post-receive.tmpl | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 post-commit.tmpl create mode 100644 post-receive.tmpl diff --git a/Makefile b/Makefile index 1c1dff4..f0cd797 100644 --- a/Makefile +++ b/Makefile @@ -2,11 +2,11 @@ PREFIX?=/var/empty -all: post-commit +all: post-receive @echo Done %: %.tmpl %.json jinja2 --outfile=$@ --format=json $@.tmpl $@.json -install: post-commit - cp post-commit ${PREFIX}/ +install: post-receive + cp post-receive ${PREFIX}/ diff --git a/post-commit.tmpl b/post-commit.tmpl deleted file mode 100644 index 1904182..0000000 --- a/post-commit.tmpl +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -hook_active= {{ active }} -remote_url= {{ mirror_url }} - -if [ "$hook_active" == false ]; then - echo 'Mirror push hook is not active!' - exit -1 -fi - -if git ls-remote $remote_url; then - echo "mirro_foo" > /tmp/mirror_foo -else - echo "mirror_bat" > /tmp/mirror_baz -fi diff --git a/post-receive.tmpl b/post-receive.tmpl new file mode 100644 index 0000000..1904182 --- /dev/null +++ b/post-receive.tmpl @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +hook_active= {{ active }} +remote_url= {{ mirror_url }} + +if [ "$hook_active" == false ]; then + echo 'Mirror push hook is not active!' + exit -1 +fi + +if git ls-remote $remote_url; then + echo "mirro_foo" > /tmp/mirror_foo +else + echo "mirror_bat" > /tmp/mirror_baz +fi -- cgit v1.2.3