Given the directory structure:
/Users/doge/very/amaze.js
/usr/local/bin/wow
/node_modules/
/css/
/css/somefile.css
/lib/
/somelib/
/anotherlib/somedir/finallib.js
/index.html
/somefile.test
/somelib/file.html
/firstdir/seconddir/file.css
/node_modules.txt
How can I exclude only the node_modules directory using extglob?
/!(node_modules)
The above matches everything at the root level, except for the node_modules directory and the text file (which we want to include). It also does not recursively match directories.
/!(node_modules)/**
This object is closer, but it also excludes all files in the root directory. Even if it contains files at the root level, I assume that it will exclude the node_modules.txt file.
PS This is for mapping files using grunt-ssh and minimatch node.