Skip to content

Commit

Permalink
Merge pull request #10 from giacomozinetti/master
Browse files Browse the repository at this point in the history
fix ansi color for iterm2 on macosx
  • Loading branch information
ruyadorno committed Sep 6, 2016
2 parents 60bbb1a + b193434 commit 2b3dc43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ var events = require('events');

var inquirer = require('inquirer');

var stripAnsi = require('strip-ansi');


// ---

Expand Down Expand Up @@ -62,14 +64,14 @@ module.exports = function gitBranchCheckout(exec, options) {

function onBranchChosen(answers) {
exec(
'git checkout ' + answers.branches,
'git checkout ' + stripAnsi(answers.branches),
onCheckout.bind(null, answers.branches)
);
}

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

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
],
"dependencies": {
"inquirer": "^0.8.x",
"simple-output": "^1.0.x"
"simple-output": "^1.0.x",
"strip-ansi": "^3.0.1"
},
"devDependencies": {
"mocha": "*"
Expand Down

0 comments on commit 2b3dc43

Please sign in to comment.