Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
zipHtml() {
return gulp.src(this.module.zipSrcPathHtmls, {base: this.module.zipPathBaseHtmls})
.pipe(zip(this.module.zipFileNameHtmls))
.pipe(gulp.dest(this.module.zipPathOutput));
}
const compress = (src, name, dest = './build') => () => {
gulp.src(src)
.pipe(zip(name))
.pipe(gulp.dest(dest));
};
globby.sync(['dist/*', '!dist/zip']).map(dir =>
gulp.src(path.join(dir, '**/*'))
.pipe(zip(`${path.basename(dir)}.zip`))
.pipe(gulp.dest('dist/zip'))
)
static build() {
return gulp
.src([
'build/**',
])
.pipe(zip('artifacts.build.zip'))
.pipe(gulp.dest('./'));
}
gulp.task('zip', () => {
const datetime = process.env.ZIP_DATE_TIME ? '-' + getDateTime() : '';
const zipName = 'dist' + datetime + '.zip';
gulp.src(['dist/**/*', '!dist/*.zip'])
.pipe(zip(zipName))
.pipe(gulp.dest('dist'));
});
export default function zip(
filename: string,
options?: gulpZip.GulpZipOptions,
) {
return new pumpify.obj(
vinylBuffer(),
gulpDuplicates(),
gulpZip(filename, options),
);
}
gulp.task('archive', () => {
return gulp
.src(config.archive.source)
.pipe(zip(`${config.version}.zip`))
.pipe(gulp.dest(config.archive.build))
.pipe(
gulpif(
config.enable.notify,
notify({
title: config.notify.title,
message: 'Archive task complete',
})
)
);
});