logging - How do you get a git log output from a shelljs.exec command? -


i need put git log file. command line works fine

git log command line result

but if call command grunt task using shelljs.exec, dont output

git log grunt task using shelljs.exec

here 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 shelljs docs , tried different ways (including async) no success...

any idea ? thx

try use .stdout instead of .output.

in code:

shell.exec(   'git log head...head^ --oneline',   {silent : true} ).output; 

change to:

shell.exec(   'git log head...head^ --oneline',   {silent : true} ).stdout; 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -