]> gitweb.fluxo.info Git - templater.git/commitdiff
Adds post_receive target into main Makefile
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 17 Nov 2017 12:19:41 +0000 (10:19 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 17 Nov 2017 12:19:41 +0000 (10:19 -0200)
share/templater/pushtodeploy/setup
share/templater/templater/files/Makefile

index 78e216f49dc40c1add17ac98dd13c5589c8db221..b7c3c670c208f81635a6a14ce8d8d667551975dc 100755 (executable)
@@ -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
index a53fcbb31254ab2dd0336db0966fb7ad73080e67..02c7af639b0f1a388675764330bc6583421a2ae2 100644 (file)
@@ -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.*