Closed djmittens closed 9 years ago
That does not answer my question, because if you execute that code the file when extracted will extract into the current directory and not make a new one. I want to be able to name a directory after the zip
for instance
unzip tremor.zip
should produce a directory named tremor
and not unpack all the files into the cwd
For those, like me, stumble upon this issue, the solution is there : https://github.com/sindresorhus/gulp-zip/issues/23#issuecomment-46083758
You can use gulp-rename to add a "parent" directory:
gulp.src(your_files)
.pipe(
rename(
function(path) {
path.dirname = 'parent-diretory/' + path.dirname;
}
)
)
.pipe(zip('your-zip-file.zip'))
.pipe(gulp.dest('.'));
Clearly doing this
produces a zip with a flat file structure, but i want the zip file to unzip into a folder when running unzip command, so is there any way to stuff all the output into a folder before zipping it up?