andrewdavey/cassette — Issue #159: Cassette should run the Exclude match against directories in addition to files
Author: kamranayub
Created: 2012-02-08 16:19:19+00:00
State: open

I need to research this a bit more, but as I understand the current process, Cassette will run the Exclude match in an IFileSearch only against files it finds within directories. I documented this [in my original blog post](http://kamranicus.com/Blog/Posts/27/using-cassette-for-semi-complicated-scenarios-upda) (where the `~/Public/scripts/pages` directory is still considered a bundle albeit empty) about advanced Cassette usage.

The issue that we're running into is that we nest assets under a `public` folder, so when we bundle PerSubDirectory, some directories will not contain any assets thus causing Cassette to throw a "silent" exception. I'm reporting this second-hand, which is why I want to look into it. Apparently this means we are getting exception emails on every request but Cassette still works fine and assets are bundled fine.

I believe the solution would be when Cassette starts to read in the directory name, it runs the Exclude against it. So a Regex of `\\images` will match and tell Cassette to ignore the folder contents thus preventing any exceptions. I think this might also help performance (avoiding throwing exceptions).