From 83f97407e80893948dc5add8953d1d68828ca209 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 10 May 2018 10:48:06 -0400 Subject: [PATCH] touch ups --- lib/pipeline/pipeline.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/pipeline/pipeline.js b/lib/pipeline/pipeline.js index 70bc16930..15a36b4c5 100644 --- a/lib/pipeline/pipeline.js +++ b/lib/pipeline/pipeline.js @@ -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();