From 9b0c86f15de350d891d3f2afdd38c4cb612763e3 Mon Sep 17 00:00:00 2001 From: charliedowler Date: Sun, 22 Mar 2015 22:45:48 +0000 Subject: [PATCH] Fix the abort option #25 --- index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 30144a2..8e3a066 100644 --- a/index.js +++ b/index.js @@ -56,17 +56,19 @@ function getFlowBin() { return process.env.FLOW_BIN || flowBin; } -function executeFlow(_path, opts) { +function executeFlow(_path, options) { var deferred = Q.defer(); - var command = optsToArgs(opts).length ? (() => { + var opts = optsToArgs(options); + + var command = opts.length ? (() => { servers.push(path.dirname(_path)); return 'check'; })() : 'status'; var args = [ command, - ...optsToArgs(opts), + ...opts, '/' + path.relative('/', _path), '--json' ]; @@ -115,7 +117,7 @@ function executeFlow(_path, opts) { if (result.errors.length) { passed = false; reporter(flowToJshint(result)); - if (args.abort) { + if (options.abort) { deferred.reject(new gutil.PluginError('gulp-flow', 'Flow failed')); } else {