diff options
Diffstat (limited to 'node_modules/gulp-tar/index.js')
-rw-r--r-- | node_modules/gulp-tar/index.js | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/node_modules/gulp-tar/index.js b/node_modules/gulp-tar/index.js deleted file mode 100644 index eea7e2722..000000000 --- a/node_modules/gulp-tar/index.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; -const path = require('path'); -const through = require('through2'); -const archiver = require('archiver'); -const PluginError = require('plugin-error'); -const Vinyl = require('vinyl'); - -module.exports = (filename, options) => { - if (!filename) { - throw new PluginError('gulp-tar', '`filename` required'); - } - - let firstFile; - const archive = archiver('tar', options); - - return through.obj((file, enc, cb) => { - if (file.relative === '') { - cb(); - return; - } - - if (firstFile === undefined) { - firstFile = file; - } - - archive.append(file.contents, Object.assign({ - name: file.relative.replace(/\\/g, '/') + (file.isNull() ? '/' : ''), - mode: file.stat && file.stat.mode, - date: file.stat && file.stat.mtime ? file.stat.mtime : null - }, options)); - - cb(); - }, function (cb) { - if (firstFile === undefined) { - cb(); - return; - } - - archive.finalize(); - - this.push(new Vinyl({ - cwd: firstFile.cwd, - base: firstFile.base, - path: path.join(firstFile.base, filename), - contents: archive - })); - - cb(); - }); -}; |