[build] added gulp builder

This commit is contained in:
2017-12-17 22:29:16 +03:00
parent 823799e8fb
commit 69c2b735a0
24 changed files with 1273 additions and 4 deletions

26
tasks/tail.js Executable file
View File

@@ -0,0 +1,26 @@
'use strict';
const through = require('through2');
const gutil = require('gulp-util');
const col = gutil.colors;
const Tail = require('tail').Tail;
module.exports = (handler) => {
let stream = null;
let tail = null;
const bufferContents = (file, enc, callback) => {
tail = new Tail(file.path);
tail.on("line", handler);
callback();
};
const endStream = (callback) => {
if (tail) {
tail.unwatch();
tail = null;
}
callback();
};
return stream = through.obj(bufferContents, endStream);
};