twolfson / grunt-zip

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

Grunt 4 compatibility #17

Closed lrvick closed 11 years ago

lrvick commented 11 years ago

Does not appear to be compatible with Grunt 4.1

zip: { 'unzip': { '.somefolder' : 'somefolder.zip' } }

Warning: Cannot read property 'src' of undefined Use --force to continue.

twolfson commented 11 years ago

Ah, cool. Sounds like a bug in grunt-retro. I will take a look by the end of this weekend.

twolfson commented 11 years ago

Looked into this for a bit. It seems that this.files doesn't work normally with the compact format. Additionally, that API has been marked as deprecated.

http://gruntjs.com/configuring-tasks#older-formats

I will still be adding in the functionality to grunt-retro but it might take longer than expected.

twolfson commented 11 years ago

Okay... it looks like nothing was wrong, the problem is with your configuration. For the compact format, you cannot nest them inside of an object (which you are doing with unzip).

It is unclear if you want to zip or unzip so here are the fixed configs for both cases:

zip .somefolder to somefolder.zip

zip: {
  'somefolder.zip': '.somefolder'
}

unzip contents of somefolder.zip to somefolder

unzip: {
  '.somefolder': 'somefolder.zip'
}