From bbff7403fbf46f9ad92240ac213df8d30ef31b64 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 20 Sep 2018 02:56:13 +0200 Subject: update packages --- node_modules/gulp-zip/index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'node_modules/gulp-zip/index.js') diff --git a/node_modules/gulp-zip/index.js b/node_modules/gulp-zip/index.js index 9f3e080a6..52794e451 100644 --- a/node_modules/gulp-zip/index.js +++ b/node_modules/gulp-zip/index.js @@ -1,13 +1,14 @@ 'use strict'; const path = require('path'); -const gutil = require('gulp-util'); +const Vinyl = require('vinyl'); +const PluginError = require('plugin-error'); const through = require('through2'); const Yazl = require('yazl'); const getStream = require('get-stream'); module.exports = (filename, opts) => { if (!filename) { - throw new gutil.PluginError('gulp-zip', '`filename` required'); + throw new PluginError('gulp-zip', '`filename` required'); } opts = Object.assign({ @@ -32,13 +33,13 @@ module.exports = (filename, opts) => { if (file.isNull() && file.stat && file.stat.isDirectory && file.stat.isDirectory()) { zip.addEmptyDirectory(pathname, { - mtime: file.stat.mtime || new Date(), + mtime: opts.modifiedTime || file.stat.mtime || new Date(), mode: file.stat.mode }); } else { const stat = { compress: opts.compress, - mtime: file.stat ? file.stat.mtime : new Date(), + mtime: opts.modifiedTime || (file.stat ? file.stat.mtime : new Date()), mode: file.stat ? file.stat.mode : null }; @@ -59,14 +60,14 @@ module.exports = (filename, opts) => { } getStream.buffer(zip.outputStream).then(data => { - this.push(new gutil.File({ + this.push(new Vinyl({ cwd: firstFile.cwd, base: firstFile.base, path: path.join(firstFile.base, filename), contents: data })); - cb(); // eslint-disable-line promise/no-callback-in-promise + cb(); }); zip.end(); -- cgit v1.2.3