touch ups

This commit is contained in:
Jonathan Rainville 2018-05-10 10:48:06 -04:00
parent 31e82e31d0
commit 83f97407e8
1 changed files with 5 additions and 7 deletions

View File

@ -18,6 +18,7 @@ class Pipeline {
this.events = options.events;
this.logger = options.logger;
this.plugins = options.plugins;
this.pipelinePlugins = this.plugins.getPluginsFor('pipeline');
}
build(abi, contractsJSON, path, callback) {
@ -57,6 +58,7 @@ class Pipeline {
function (file, fileCb) {
self.logger.trace("reading " + file.filename);
// Not a JS file
if (file.filename.indexOf('.js') < 0) {
return file.content(function (fileContent) {
self.runPlugins(file, fileContent, fileCb);
@ -73,10 +75,7 @@ class Pipeline {
webpackProcess.on('message', function (msg) {
if (msg.result === constants.pipeline.built) {
webpackProcess.disconnect();
if (msg.error) {
return next(msg.error);
}
return next();
return next(msg.error);
}
if (msg.result === constants.pipeline.log) {
@ -154,11 +153,10 @@ class Pipeline {
runPlugins(file, fileContent, fileCb) {
const self = this;
let pipelinePlugins = self.plugins.getPluginsFor('pipeline');
if (pipelinePlugins.length <= 0) {
if (self.pipelinePlugins.length <= 0) {
return fileCb(null, {content: fileContent, filename: file.filename, path: file.path, basedir: file.basedir, modified: true});
}
async.eachSeries(pipelinePlugins,
async.eachSeries(self.pipelinePlugins,
function(plugin, pluginCB) {
if (file.options && file.options.skipPipeline) {
return pluginCB();