sindresorhus / gulp-zip

ZIP compress files
MIT License
270 stars 47 forks source link

Created archive does not work with lambda? #83

Closed re-jim closed 7 years ago

re-jim commented 7 years ago

I have this:

gulp.task('newInstanceSetup', function() {
    return gulp.src('./**/*',{cwd:'./new_instance_setup'})
        .pipe(zip('archive.zip'))
        .pipe(lambda(newInstanceSetup_params, opts))
        .pipe(gulp.dest('.'));
});

This causes errors when the code is executed by AWS Lambda.

If I manually zip the contents of the folder (select all > right click > 7-zip > add to archive...) it'll create an archive that works with Lambda.

If I manually upload the archive.zip created by the gulp process, Lambda will throw an error when executing the code. That leads me to believe that the error is somewhere in the gulp zipping process.

If I inspect both of the archives the filesize is different, but the contents look the same at first glance.

re-jim commented 7 years ago

Found the solution from #64 , add nodir:true

deanshelton913 commented 6 years ago

{nodir:true} still leaves a parent directory in the zip