Skip to content

Commit

Permalink
fix: use the same approach as eslint (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanoii authored Oct 7, 2024
1 parent 3fae507 commit 8562303
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 exec \"cd $DDEV_DOCROOT/core && yarn install\"'"
exit 1
Expand Down

0 comments on commit 8562303

Please sign in to comment.