Skip to content

Commit

Permalink
Fix the abort option #25
Browse files Browse the repository at this point in the history
  • Loading branch information
charliedowler committed Mar 22, 2015
1 parent a995fea commit 9b0c86f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
];
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 9b0c86f

Please sign in to comment.