From fbe7a6024a30340c7f6b1146c601860e1f0bc9ca Mon Sep 17 00:00:00 2001 From: Mathias Elle Date: Mon, 21 Oct 2024 09:59:31 +0200 Subject: [PATCH] Update CHANGELOG.md for version 1.8.1 and improve Grunt installation checks (#51) --- CHANGELOG.md | 3 ++- commands/web/woodoo_components/build | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36675bc..ce102fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,14 @@ All notable changes to this project will be documented in this file. --- -## UNRELEASED 1.9.0 +## UNRELEASED 1.8.1 - added documentation for color assignments in `CONTRIBUTING.md` to standardize the use of color variables in bash scripts - added detailed color definitions and a usage example in the new "Color Assignments" section - added Github Action to check if Pull Request contains `CHANGELOG.md` updates - added Discord invite link to `README.md` and `CONTRIBUTING.md` - changed `MIT-LICENSES.md` to `LICENSE` and set this tool under GNU GENERAL PUBLIC LICENSE 3.0 +- fixed issue to check and install grunt correctly if it is missing [https://github.com/dermatz/ddev-woodoo-buildtools-magento/issues/50] --- diff --git a/commands/web/woodoo_components/build b/commands/web/woodoo_components/build index ac2a67a..4c7cdd7 100644 --- a/commands/web/woodoo_components/build +++ b/commands/web/woodoo_components/build @@ -15,14 +15,18 @@ function buildMagentoDefault() { fi # check if grunt exist - if ! command -v grunt &>/dev/null; then + if "${DDEV_COMPOSER_ROOT}/node_modules/.bin/grunt" --version &>/dev/null; then + echo -e "${txtcyn}${ICON_SUCCESS} Grunt is installed${txtrst}" + else echo -e "\n\n${txtcyn}${ICON_ERROR} Install missing Grunt${txtrst}\n\n" + npm install grunt # install grunt locally in ddev container for the project - npm install grunt - sudo npm install grunt -g + if ! command -v grunt &>/dev/null; then + sudo npm install grunt -g + fi if ! command -v grunt &>/dev/null; then - echo -e "${txtred}${ICON_ERROR} Could not install grunt. Please check your installation.${txtrst}" + echo -e "${txtred}${ICON_ERROR} Could not install grunt global. Please install grunt manually ${txtcyn}sudo npm install grunt -g ${txtrst}." else echo -e "${txtcyn}${ICON_SUCCESS} Grunt installed successfully.${txtrst}" fi