twolfson / grunt-zip

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

Add cwd support for zip #1

Closed twolfson closed 11 years ago

twolfson commented 11 years ago

Allow for specification of a working directory during zipping. This will allow for simplification of file paths by removing unnecesary folders.

twolfson commented 11 years ago

For the implementation, I would prefer to open a higher level router option which takes:

'router': function (filepath) {
  // Tweak file path -- this can be via cwd or some custom routing
  return tweakedFilepath;
};

Then, cwd hooks on top of router -- allowing for even more customizablility if anyone ever wants it.

twolfson commented 11 years ago

Patched in 0.5

@markusfalk If you use the following, you will no longer have the build/ prefix in your zip files.

{
  zip: {
    src: ['build/**/*'],
    dest: 'html.zip',
    cwd: 'build/'
  }
}