twolfson / grunt-zip

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

i only to zip files and dirs #22

Closed kitemao closed 10 years ago

kitemao commented 10 years ago

if i have a 'project' folder, there are many files and dirs in this folder, now i only want to zip those files and dirs, and not contain this 'project' folder, how should i to set 'src' field

twolfson commented 10 years ago

src always contains itself in the zip. To work around that, you have to either use cwd or router.

For your case, cwd is the easiest to integrate:

{
  zip: {
    cwd: 'project/',
    src: '**/*',
    dest: 'project.zip'
  }
}
kitemao commented 10 years ago

thank you