Closed st-schneider closed 6 years ago
Maybe this:
return gulp.src('/themes/**/public/**', { nodir: true })
...
https://github.com/isaacs/node-glob#options
nodir Do not match directories, only files. (Note: to match only directories, simply put a / at the end of the pattern.)
We should pass the actual file in as a second arg so we can utilize this https://github.com/gulpjs/vinyl#fileisdirectory or other checks (maybe you want to rename based on contents? who knows)
Thank you
At least for this use case, @heikki's solution is most suitable.
I have a glob like
/themes/**/public/**
where I want to rename the files by eliminating thepublic
folder. Currently I have to goIt is a bit cumbersome to have to rename empty folders as well. If I leave out the
if
I end up with and empty public folder in the dest. Is there a way to only affect files and not folders?