Skip to content

Commit

Permalink
fix: use the same approach as eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
hanoii committed Oct 7, 2024
1 parent ce51537 commit 9d06007
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions commands/web/stylelint
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9d06007

Please sign in to comment.