twolfson / grunt-zip

Zip and unzip files via a grunt plugin
MIT License
87 stars 19 forks source link

Filter files when unzipping #12

Closed curiousdannii closed 11 years ago

curiousdannii commented 11 years ago

It would be nice to be able to filter files when unzipping. What about if false is returned from a router function then the file would be skipped?

twolfson commented 11 years ago

Comically, I have had the same use case before but did not alter grunt-zip to handle it (though I had the same falsy thought). Instead I used .gitignore and copied the files I needed grunt-contrib-copy.

I will add the falsy functionality to zip, unzip, and other router implementations.

curiousdannii commented 11 years ago

In my case the entire folder is ignored. There's no real harm being done by the extra files, it would just be neater if they weren't there. Thanks for looking into this! :)

twolfson commented 11 years ago

Implemented and added tests for this in 0.9.0. I went with the falsy implementation as discussed (for more info see the README). Run npm install grunt-zip --save-dev to update your package.json.

It turns out I did not abstract a common router for my other grunt-tasks as I had thought. As a result, I will leave those repos alone for now.