diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/gulp-zip/index.js | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) |
update packages
Diffstat (limited to 'node_modules/gulp-zip/index.js')
-rw-r--r-- | node_modules/gulp-zip/index.js | 13 |
1 files changed, 7 insertions, 6 deletions
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(); |