Skip to content

Commit

Permalink
Changing git.findRoot to be synchronous, using execSync.
Browse files Browse the repository at this point in the history
  • Loading branch information
henvic committed Jan 8, 2015
1 parent 24c0850 commit 11605a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'use strict';

var logger = require('./logger'),
execSync = require('execSync'),
spawn = require('child_process').spawn;

exports.checkout = function(branch, opt_newBranch, opt_callback) {
Expand Down Expand Up @@ -90,10 +91,8 @@ exports.exec = function(cmd, args, opt_callback, opt_log) {
});
};

exports.findRoot = function(opt_callback) {
exports.exec('rev-parse', ['--show-toplevel'], function(err, data) {
opt_callback(err, data.trim());
});
exports.findRoot = function() {
return execSync.exec('git rev-parse --show-toplevel').stdout.slice(0, -1);
};

exports.getCommitMessage = function(opt_branch, opt_number, opt_callback) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"cli-color": "^0.3.2",
"cli-log": "^0.0.8",
"copy-paste": "^0.3.0",
"execSync": "^1.0.2",
"github": "^0.2.2",
"handlebars": "^2.0.0",
"inquirer": "^0.7.1",
Expand Down

0 comments on commit 11605a1

Please sign in to comment.