[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

35
tasks/neko.js Normal file
View File

@@ -0,0 +1,35 @@
const exec = require('./exec');
const gutil = require('gulp-util');
const through = require('through2');
const col = gutil.colors;
class Neko {
constructor() {
this.tag = 'Neko';
}
run() {
let stream = null;
const bufferContents = (file, enc, callback) => {
gutil.log(this.tag, col.cyan("run"), col.magenta(file.path));
exec('.', ['neko', file.path].join(' '))
.then(() => {
stream.emit('end');
callback();
})
.catch((error) => {
stream.emit('error', new gutil.PluginError({plugin: this.tag, message: error}));
callback();
});
stream.push(file);
};
return stream = through.obj(bufferContents);
}
}
module.exports = Neko;