Skip to content

Commit

Permalink
fix error with stdout in callback - close #110
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlacy committed Apr 5, 2016
1 parent 1512a24 commit 72c823d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ module.exports = function (version, message, opt, cb) {
if (version !== '') {
cmd += ' ' + signedarg + ' -m "' + message + '" ' + opt.args + ' ' + escape([version]);
}
var templ = gutil.template(cmd, {file:message});
var templ = gutil.template(cmd, {file: message});
return exec(templ, {cwd: opt.cwd}, function(err, stdout, stderr){
if (err) return cb(err);
if (!opt.quiet && version !== '') gutil.log(stdout, stderr);
if (version === '') {
stdout = stdout.split('\n');
}
cb(stdout);
return cb();
});
};
9 changes: 6 additions & 3 deletions test/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ module.exports = function(git, testFiles, testCommit){
// These must be run on a system which has git installed
// no pull delay, and has git configured.


it('should tag a version of the repo', function(done) {

git.tag('v1.2.3', 'message', {cwd: './test/'}, function() {
should.exist('test/.git/refs/tags/v1.2.3');
done();
});

});

it('should not throw an error on success', function(done) {
git.tag('v2', 'message', {cwd: './test/'}, function(err) {
should.not.exist(err);
done();
});
});
};

0 comments on commit 72c823d

Please sign in to comment.