From 5e31b15fbcd3a7a652f15cf1a59b2fc644e114c5 Mon Sep 17 00:00:00 2001 From: Thomas Metois Date: Wed, 1 Mar 2017 09:14:00 +0100 Subject: [PATCH] EVO: update-all.sh > test if module dir exist else use vendor for update monarc modules --- scripts/update-all.sh | 65 +++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/scripts/update-all.sh b/scripts/update-all.sh index 1e54a58..d60c839 100755 --- a/scripts/update-all.sh +++ b/scripts/update-all.sh @@ -13,42 +13,59 @@ git pull php composer.phar update -o -pull_if_exists module/MonarcCore -pull_if_exists module/MonarcBO -pull_if_exists module/MonarcFO +currentPath=`pwd` +pathCore="module/MonarcCore" +if [ -d $pathCore ]; then + pull_if_exists $pathCore +else + pathCore="vendor/monarc/core" +fi +pathBO="module/MonarcBO" +if [ -d $pathBO ]; then + pull_if_exists $pathBO +else + pathBO="vendor/monarc/backoffice" +fi +pathFO="module/MonarcFO" +if [ -d $pathFO ]; then + pull_if_exists $pathFO +else + pathFO="vendor/monarc/frontoffice" +fi + 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 +if [ -d $pathCore ]; then + php ./vendor/robmorgan/phinx/bin/phinx migrate -c ./$pathCore/migrations/phinx.php + if [ -d "${pathCore}/hooks" ]; then + cd $pathCore/.git/hooks ln -s ../../hooks/pre-commit.sh pre-commit 2>/dev/null chmod u+x pre-commit - cd ../../../../ + cd $currentPath fi fi -if [ -d module/MonarcFO ]; then - php ./vendor/robmorgan/phinx/bin/phinx migrate -c ./module/MonarcFO/migrations/phinx.php +if [ -d $pathBO ]; then + php ./vendor/robmorgan/phinx/bin/phinx migrate -c ./$pathBO/migrations/phinx.php - if [ -d module/MonarcFO/hooks ]; then - cd module/MonarcFO/.git/hooks + if [ -d "${pathBO}/hooks" ]; then + cd $pathBO/.git/hooks ln -s ../../hooks/pre-commit.sh pre-commit 2>/dev/null chmod u+x pre-commit - cd ../../../../ + cd $currentPath + fi +fi + +if [ -d $pathFO ]; then + php ./vendor/robmorgan/phinx/bin/phinx migrate -c ./$pathFO/migrations/phinx.php + + if [ -d "$pathFO/hooks" ]; then + cd $pathFO/.git/hooks + ln -s ../../hooks/pre-commit.sh pre-commit 2>/dev/null + chmod u+x pre-commit + cd $currentPath fi fi