diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-03-27 21:01:33 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-03-27 21:01:33 +0100 |
commit | cc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch) | |
tree | 92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/gulp-tar/index.js | |
parent | 3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff) |
remove node_modules
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(); - }); -}; |