From 791d2cd39cf79f7e3c059de0fca0f2f6a3644394 Mon Sep 17 00:00:00 2001 From: maxingchi Date: Thu, 7 Jul 2016 17:31:39 +0800 Subject: [PATCH] fix json parse log error because of git pagination --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index fc3d578..6b8bfb4 100755 --- a/index.js +++ b/index.js @@ -20,7 +20,7 @@ module.exports = { _command('git describe --always --tag --abbrev=0', cb) } , log : function (cb) { - _command('git log --no-color --pretty=format:\'[ "%H", "%s", "%cr", "%an" ],\' --abbrev-commit', function (str) { + _command('git --no-pager log --no-color --pretty=format:\'[ "%H", "%s", "%cr", "%an" ],\' --abbrev-commit', function (str) { str = str.substr(0, str.length-1) cb(JSON.parse('[' + str + ']')) })