Add git debugging to publish command
This commit is contained in:
+12
-7
@@ -8,13 +8,18 @@ module.exports = function(grunt) {
|
||||
var done = this.async();
|
||||
initSDK();
|
||||
|
||||
git.commitInfo(function(err, info) {
|
||||
if (info.isMaster) {
|
||||
publish(fileMap(['-latest', '-' + info.head]), done);
|
||||
} else {
|
||||
// Silently ignore for branches
|
||||
done();
|
||||
}
|
||||
git.debug(function(remotes, branches) {
|
||||
grunt.log.writeln('remotes: ' + remotes);
|
||||
grunt.log.writeln('branches: ' + branches);
|
||||
|
||||
git.commitInfo(function(err, info) {
|
||||
if (info.isMaster) {
|
||||
publish(fileMap(['-latest', '-' + info.head]), done);
|
||||
} else {
|
||||
// Silently ignore for branches
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
grunt.registerTask('publish:version', function() {
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
var childProcess = require('child_process');
|
||||
|
||||
module.exports = {
|
||||
debug: function(callback) {
|
||||
childProcess.exec('git remote -v', {}, function(err, remotes) {
|
||||
if (err) {
|
||||
throw new Error('git.remote: ' + err.message);
|
||||
}
|
||||
|
||||
childProcess.exec('git branch -a', {}, function(err, branches) {
|
||||
if (err) {
|
||||
throw new Error('git.branch: ' + err.message);
|
||||
}
|
||||
|
||||
callback(remotes, branches);
|
||||
});
|
||||
});
|
||||
},
|
||||
clean: function(callback) {
|
||||
childProcess.exec('git diff-index --name-only HEAD --', {}, function(err, stdout) {
|
||||
callback(undefined, !err && !stdout);
|
||||
|
||||
Reference in New Issue
Block a user