Sunday, April 17, 2016

Version control metadata sometimes missing when I use pm2

Leave a Comment

enter image description here

What does it depend on?

Repository information in package.json ? Nothing different.

Is this a silly question?

UPDATED: after reading pm2's source code, I found an error occured in git.parse.

/usr/local/lib/node_modules/pm2/node_modules/vizion/lib/git.js

And I try to exec in the repl child_process.exec("git show --quiet --format=%H%n%aD%n%s%n% HEAD",function(e,d){console.log(e)}) it will print { [Error: Command failed: /bin/sh -c git show --quiet --format=%H%n%aD%n%s%n%B HEAD ] killed: false, code: 1, signal: null, cmd: '/bin/sh -c git show --quiet --format=%H%n%aD%n%s%n%B HEAD' } 'adce83ece6c0e63112e7c9551ffca798e0130be6\nTue, 12 Apr 2016 16:23:02 +0800\nuser\n%B\n'

child_process.exec("git show HEAD",function(e,d){console.log(e)}) print null

git version too low? 1.7.1 or node version ? 0.12.0

UPDATED: Finaly I found the reason is that git version is too low. after upgrade git, it works fine.

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment