[tail] added TailVinyl class

This commit is contained in:
2018-05-04 16:32:49 +03:00
parent bf426a0d2e
commit d3f8f4940c
2 changed files with 28 additions and 7 deletions

View File

@@ -6,6 +6,7 @@ const through = require('through2');
const Sdk = require('./sdk');
const Vinyl = require('vinyl');
const run = require('../run/index');
const {TailVinyl} = require('./tail');
class FlashPlayer extends Sdk {
@@ -99,7 +100,11 @@ class FlashPlayer extends Sdk {
FlashPlayer.enableLog();
return run(`${this.flashPlayerBin} ${filename}`, params).exec()
.pipe(through.obj(function (file, enc, callback) {
this.push(new Vinyl({path: FlashPlayer.log}));
const log = new TailVinyl({
path: FlashPlayer.log,
});
this.on('end', () => log.dispose());
this.push(log);
callback();
}));
}