twolfson / grunt-zip

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

add option to fail if unzip cannot find any files to unzip #24

Closed Michael-Gannon closed 10 years ago

Michael-Gannon commented 10 years ago

If the configuration specified cannot resolve a file(s) to unzip the output is successful and 'File "' + this.file.dest + '" created.' is printed, this is not true if the files were not found.

twolfson commented 10 years ago

Nice catch. The issue was awkwardly phrased so to reiterate, if src expands to an empty array, grunt-zip still says that it created the directory even though it didn't.

unzip: {
  doesnotexist: {
    src: 'doesnotexist.zip',
    dest: 'hello/'
  }
}

// grunt unzip logs 'File "hello/" created.'
twolfson commented 10 years ago

I will take a look at this by the end of next weekend.

Michael-Gannon commented 10 years ago

Yeah you've got the idea. Logging aside should it return a fail if it was unable to perform the unzip? It sounds like a fail scenario.

twolfson commented 10 years ago

I don't think it should fail, we just need to update the wording. The user will read that and realize something needs correction. This also seems to be grunt convention:

https://github.com/gruntjs/grunt-contrib-copy/blob/v0.5.0/tasks/copy.js#L35-L71

twolfson commented 10 years ago

Deciding to move this to the front of my queue due to its simplicity.

twolfson commented 10 years ago

All done. This has been released in 0.13.0. Additionally, I added verbose output for more detailed output when using grunt --verbose.

bladerunner2020 commented 5 years ago

I don't think it should fail, we just need to update the wording. The user will read that and realize something needs correction. This also seems to be grunt convention:

https://github.com/gruntjs/grunt-contrib-copy/blob/v0.5.0/tasks/copy.js#L35-L71

grunt-contrib-copy has an option nonull - if this option is true and file not found grunt fails. would be great to have the same behaviour to grunt-zip.

flag --verbose does help, but still would be nice to have nonull flag in grunt-zip.

twolfson commented 5 years ago

@bladerunner2020 Due to reduced popularity of grunt and personal priorities with other tasks, I'm not actively adding features to this repo. I'll happily accept a PR on that though