I need to put a git log into a file. The command line works fine
But if I call this command with a grunt task using shelljs.exec, I dont get any output
Git log with grunt task using shelljs.exec
Here the grunt code :
/*global module:false,require,console*/
'use strict';
var shell = require('shelljs');
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
// Task configuration.
});
grunt.task.registerTask('git-log', 'git log output', function () {
console.log('RESULT : ', shell.exec('git log HEAD...HEAD^ --oneline',{silent : true}).output);
});
// Default task.
grunt.registerTask('default', ['git-log']);
};
I checked all the shelljs docs and tried different ways (including async) with no success...
Any idea ? Thx
grunt.log.writeln( JSON.stringify( shell.exec('git log HEAD...HEAD^ --oneline', {silent : true}), null, 2 ) );