Sunday, 23 April 2017

Iterate recursively using for loop in windows cmd, excluding node_modules and it's subdirectories

Dear stackoverflow users I am Linux user and I am developing an app with my mates. They are using Windows and the problem is that in my package.json I got linter script which looks like so:

"scripts": {
  "lint": "eslint '.'"
}

The following script works fine on Linux (it lints all the files recursively excluding node_modules folder), but it fails on Windows. I was searching through the web and I found the script which should be used by Windows users.

"wlint": "for /r %f in (*.js) do eslint %f"

My mates have told me that it works fine on Windows except the fact that it goes through node_modules directory.

Question is: How to modify script to exclude node_modules directory?



via FieryCod

No comments:

Post a Comment