MarkPflug/Sylvan.BuildTools.Resources

Folders must contain a file for Sub-Folders to process

bryanllewis opened this issue · 2 comments

First, thanks for this package -- it's very useful.

I have a hierarchy of SQL files that I am trying to process using the StaticResourceGenerator. When I ran it, it was ignoring a bunch of folders I had because they were nested. However, if I had at least one file at each level, it worked and I just ignored the bogus "placeholder" file. If I am reading the repo correctly, you have the call to Directory.EnumerateDirectories (line 144) inside of the call to EnumerateFiles (line 122). So if there are no files, it will skip attempting to look for any folders and move on. Can the EnumerateDirectories be put outside the file loop so that we can have nested folders without having to have at least one file at each level? I am using the nesting to build up the namespace, so I don't want a file at every single folder level.

Thanks,
Bryan

foreach (var file in Directory.EnumerateFiles(folder, "*", SearchOption.TopDirectoryOnly))

Sounds like a good fix. Do you want to provide a pull request for it?