Skip to content

Commit

Permalink
Merge pull request #9 from grgzmy/no-success-msg-if-err
Browse files Browse the repository at this point in the history
dont display success msg if an error occurs during checkout
  • Loading branch information
ruyadorno committed Nov 4, 2015
2 parents c7275a6 + bbec5c8 commit 6eb18c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ module.exports = function gitBranchCheckout(exec, options) {
}

function onCheckout(branchName, err, stdout, stderr) {
validateExec(err, stdout, stderr);
result.emit('success', 'Switched to branch \'' + branchName.trim() + '\'');
if(!validateExec(err, stdout, stderr)){
result.emit('success', 'Switched to branch \'' + branchName.trim() + '\'');
}
}

exec(('git branch ' + options.join(' ')).trim(), onGitBranch);

return result;
};

0 comments on commit 6eb18c8

Please sign in to comment.