From 9ece5a26c95e040e1ddc4d1095fb0e7fdfaf4efc Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 17 Nov 2017 10:19:41 -0200 Subject: Adds post_receive target into main Makefile --- share/templater/pushtodeploy/setup | 2 +- share/templater/templater/files/Makefile | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/templater/pushtodeploy/setup b/share/templater/pushtodeploy/setup index 78e216f..b7c3c67 100755 --- a/share/templater/pushtodeploy/setup +++ b/share/templater/pushtodeploy/setup @@ -20,7 +20,7 @@ function templater_pushtodeploy { if [ -e "Makefile" ]; then if ! grep -q "^post_receive:" Makefile; then echo "post_receive:" >> Makefile - echo -e "\tcd .git/hooks && ln -sf ../../bin/post-receive" >> Makefile + echo -e "\ttest -s bin/post-receive && cd .git/hooks && ln -sf ../../bin/post-receive" >> Makefile fi fi else diff --git a/share/templater/templater/files/Makefile b/share/templater/templater/files/Makefile index a53fcbb..02c7af6 100644 --- a/share/templater/templater/files/Makefile +++ b/share/templater/templater/files/Makefile @@ -13,6 +13,9 @@ serve: #python3 -m http.server #php -S localhost:8000 +post_receive: + test -s bin/post-receive && cd .git/hooks && ln -sf ../../bin/post-receive + # Process any other Makefile whose filename matches Makefile.* # See https://www.gnu.org/software/make/manual/html_node/Include.html -include Makefile.* -- cgit v1.2.3