From b2ffa4677e1e888200230eb64af14aaab12f3531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Debois?= Date: Wed, 28 Dec 2016 14:35:53 +0100 Subject: [PATCH] Fix commit-hook install script --- Makefile | 7 ++++++- build_scripts/README.md | 5 +++++ build_scripts/install_hooks.sh | 8 -------- 3 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 build_scripts/README.md delete mode 100644 build_scripts/install_hooks.sh diff --git a/Makefile b/Makefile index 6db14e7..2ee2add 100644 --- a/Makefile +++ b/Makefile @@ -48,4 +48,9 @@ distclean : clean rm -rf elm-stuff demo/elm-stuff -.PHONY : pages elm.js clean cleanish distclean demo docs test copy-assets +install-hooks: + cp build_scripts/hooks/commit-msg .git/hooks + chmod a+x .git/hooks/commit-msg + + +.PHONY : pages elm.js clean cleanish distclean demo docs test copy-assets install-hooks diff --git a/build_scripts/README.md b/build_scripts/README.md new file mode 100644 index 0000000..1b33b3c --- /dev/null +++ b/build_scripts/README.md @@ -0,0 +1,5 @@ +Run the Makefile target 'install-hooks' from the elm-mdl root to install git +hooks, like so: + + > make install-hooks + diff --git a/build_scripts/install_hooks.sh b/build_scripts/install_hooks.sh deleted file mode 100644 index ea316ef..0000000 --- a/build_scripts/install_hooks.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -#Based on article here: https://www.sitepoint.com/introduction-git-hooks/ -#Create a hooks directory and a simple installer install-hooks.sh that links them (rather than copying): -#Anyone who clones your project can simply run bash install-hooks.sh after cloning. -#This is currently not working. Unable to find correct directory - -for i in hooks/*; do ln -s "${i}" ".git/${i}"; done \ No newline at end of file