From 9d06007f78f305933e8e2492cc9b7d67e85eb202 Mon Sep 17 00:00:00 2001 From: Ariel Barreiro Date: Mon, 7 Oct 2024 15:53:39 -0300 Subject: [PATCH] fix: use the same approach as eslint --- commands/web/stylelint | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/commands/web/stylelint b/commands/web/stylelint index d7d43f4..b39f569 100755 --- a/commands/web/stylelint +++ b/commands/web/stylelint @@ -7,8 +7,10 @@ ## Example: "ddev stylelint" ## ExecRaw: true -if yarn --cwd "$DDEV_DOCROOT/core" stylelint --version >/dev/null ; then - yarn --color --cwd "$DDEV_DOCROOT/core" --config ./.stylelintrc.json stylelint ../modules/custom/**/*.css "$@" +if $DDEV_DOCROOT/core/node_modules/.bin/stylelint --version >/dev/null ; then + # Change directory to the project root folder + cd "$DDEV_DOCROOT/modules/custom/${DDEV_SITENAME//-/_}" || exit + "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/node_modules/.bin/stylelint" --color --config "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/.stylelintrc.json" "./**/*.css" "$@" else echo "stylelint is not available. You may need to 'ddev yarn --cwd $DDEV_DOCROOT/core install'" exit 1