gkz / grasp

JavaScript structural search, replace, and refactor
http://graspjs.com
MIT License
1.28k stars 33 forks source link

exclude files and folder matching certain pattern #97

Closed ainthek closed 7 years ago

ainthek commented 8 years ago

Please would it be possible to add some way to exclude files and folders (globbing). in the API as well on CLI please

gkz commented 8 years ago

Can you give an example use case?

ainthek commented 8 years ago

Sure: codereviews often I need to exclude test folders, or special files

grasp -s "" -r . --exclude="/test/" --exclude="/tests/" --exclude "*/.profile.js",

now I have only two options, build a list of included folders (extra work and limitation of args length) or to grasp ... | grep -v "/test/" after processing, on large repo this is annoying and takes ages..

Thanx for help