Closed warengonzaga closed 8 years ago
I manage to fix my own issue! here's my quick fix for my gulp-zip problem!
if you want to exclude the parent/root folder of your files to be zip. Use the BASE!
here's my fix...
return gulp.src(paths.zipMakerToolInput)
.pipe(foreach(function(stream, file){
var fileName = file.path.substr(file.path.lastIndexOf("/")+1);
var packageName = ('./tools/zipMaker/input/'+fileName);
gulp.src(paths.zipMakerToolInput+fileName+'/**/*', {base: packageName})
.pipe(zip(fileName+".zip"))
.pipe(gulp.dest(paths.zipMakerToolOutput));
return stream;
}));
I add {base:} and define/locate the path of parent folder to be exclude in zip! and that's so easy! I didn't realize that haha.
Hello there,
I need some help on how I can achieve this output:
My dir paths:
FROM:
INTO: when unzip I want to see this, without the parent folder (package01/) each folder going to zip exclude the parent folder so when I zip theres no "package01" folder.
heres my code:
Please response as soon as possible thanks!
Regards, Waren