Permalink
Browse files

Fixed issue with order of operations in node 0.9.7

  • Loading branch information...
1 parent f1f7856 commit 42c4819b30553c6fb83371b963a76664c21006d3 @davglass committed Jan 22, 2013
Showing with 10 additions and 12 deletions.
  1. +10 −12 lib/index.js
View
@@ -51,22 +51,20 @@ var getInfo = function(callback) {
if (origin && origin.length) {
user = origin[0].trim();
repo = origin[1].trim();
+ if (!user || !repo) {
+ throw('failed to parse git remote');
+ }
+ exec(git + ' status', {
+ cwd: process.cwd()
+ }, function(err, stdout) {
+ var branch = stdout.trim().split('\n')[0];
+ branch = branch.replace('# On branch ', '') || 'master';
+ callback(user, repo, branch);
+ });
}
}
});
});
- child.on('exit', function() {
- if (!user || !repo) {
- throw('failed to parse git remote');
- }
- exec(git + ' status', {
- cwd: process.cwd()
- }, function(err, stdout) {
- var branch = stdout.trim().split('\n')[0];
- branch = branch.replace('# On branch ', '') || 'master';
- callback(user, repo, branch);
- });
- });
});
};

0 comments on commit 42c4819

Please sign in to comment.