dotfiles/.vscode/extensions/saviorisdead.RustyCode-0.18.0/node_modules/gulp-vinyl-zip/lib/dest/index.js
Cyryl Płotnicki 2f946d6200 Add .vscode
2016-09-11 10:29:13 +02:00

32 lines
627 B
JavaScript

'use strict';
var through = require('through2');
var vfs = require('vinyl-fs');
var zip = require('../zip');
var path = require('path');
function dest(zipPath, opts) {
var input = zip(path.basename(zipPath));
var output = vfs.dest(path.dirname(zipPath), opts);
var stream = through.obj(function(file, enc, cb) {
input.write(file);
cb();
}, function(cb) {
input.end();
output.on('end', function() {
stream.end();
cb();
});
});
input.pipe(output);
output.on('data', function(data) {
stream.push(data);
});
stream.resume();
return stream;
}
module.exports = dest;