From 7072b8ab7c95b5d5c4ee94f272df5151fa396585 Mon Sep 17 00:00:00 2001 From: Guillaume Lesniak Date: Thu, 8 Sep 2016 10:16:19 +0200 Subject: [PATCH] scripts: Install pre-commit hooks --- scripts/update-all.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/update-all.sh b/scripts/update-all.sh index 5b3b04d..d7e8ba6 100755 --- a/scripts/update-all.sh +++ b/scripts/update-all.sh @@ -20,14 +20,36 @@ pull_if_exists node_modules/ng_backoffice pull_if_exists node_modules/ng_client pull_if_exists node_modules/ng_anr +if [ -d module/MonarcCore/hooks ]; then + cd module/MonarcCore/.git/hooks + ln -s ../../hooks/pre-commit.sh pre-commit 2>/dev/null + chmod u+x pre-commit + cd ../../../../ +fi + + php ./vendor/robmorgan/phinx/bin/phinx migrate -c ./module/MonarcCore/migrations/phinx.php if [ -d module/MonarcBO ]; then php ./vendor/robmorgan/phinx/bin/phinx migrate -c ./module/MonarcBO/migrations/phinx.php + + if [ -d module/MonarcBO/hooks ]; then + cd module/MonarcBO/.git/hooks + ln -s ../../hooks/pre-commit.sh pre-commit 2>/dev/null + chmod u+x pre-commit + cd ../../../../ + fi fi if [ -d module/MonarcFO ]; then php ./vendor/robmorgan/phinx/bin/phinx migrate -c ./module/MonarcFO/migrations/phinx.php + + if [ -d module/MonarcFO/hooks ]; then + cd module/MonarcFO/.git/hooks + ln -s ../../hooks/pre-commit.sh pre-commit 2>/dev/null + chmod u+x pre-commit + cd ../../../../ + fi fi if [ -d node_modules/ng_backoffice ]; then