diff --git a/build_ohana.sh b/build_ohana.sh index 2ee70823c72210b644a98fe41f44f65a9bfc9c91..87170157b88ef90ba475830d6cf33bcd5ec09bc5 100755 --- a/build_ohana.sh +++ b/build_ohana.sh @@ -47,11 +47,9 @@ echo "Done installing correct npm version." if [[ $build_option == 1 || $build_option == 3 ]]; then echo "**************************************************************************************" echo "Setting up theming ..." - if [[ $build_option == 1 || $build_option == 3 ]]; then - ln -s "$DRUPAL_PATH"/web/profiles/uw_base_profile/modules/custom/uw_wcms_ohana/ohana/dist "$DRUPAL_PATH"/web/profiles/uw_base_profile/modules/custom/uw_wcms_ohana/dist - rm -rf src/patterns - ln -s ../../src/patterns src/patterns - fi + ln -s "$DRUPAL_PATH"/web/profiles/uw_base_profile/modules/custom/uw_wcms_ohana/ohana/dist "$DRUPAL_PATH"/web/profiles/uw_base_profile/modules/custom/uw_wcms_ohana/dist + rm -rf src/patterns + ln -s ../../src/patterns src/patterns echo "**************************************************************************************" echo "Done setting up theming." fi @@ -71,14 +69,25 @@ npm run build echo "**************************************************************************************" echo "Done running npm run build." -if [[ $build_option != 1 && $build_option != 3 ]]; then +if [[ $build_option == 2 || $build_option == 4 ]]; then echo "**************************************************************************************" echo "Setting up css/js and removing ohana ..." - mv "$DRUPAL_PATH"/web/profiles/uw_base_profile/modules/custom/uw_wcms_ohana/ohana/dist "$DRUPAL_PATH"/web/profiles/uw_base_profile/modules/custom/uw_wcms_ohana/ - cd "$DRUPAL_PATH"/web/profiles/uw_base_profile/modules/custom/uw_wcms_ohana/ohana/dist/css - rm !("all.min.css") - cd "$DRUPAL_PATH"/web/profiles/uw_base_profile/modules/custom/uw_wcms_ohana/ohana/dist/js - rm !("all.min.js") + cd .. + if [[ ! -d ohana ]]; then + mkdir dist + fi + cp -r ohana/dist/* dist + cd dist/css + find . -type f -not -name 'all.min.css' -delete + cd ../js + find . -type f -not -name 'all.min.js' -delete + cd .. + if [[ -d vendor ]]; then + rm -rf vendor + fi + if [[ -d dist ]]; then + rm -rf dist + fi cd "$DRUPAL_PATH"/web/profiles/uw_base_profile/modules/custom/uw_wcms_ohana/ rm -rf ohana echo "**************************************************************************************"