在Heroku上使用节点git-rev
我正在使用节点包git-rev让我的应用程序输出它自己的版本。 所以我创build了这个方法:
var git = require('git-rev'); module.exports = function (req, res) { git.long(function (commit) { git.branch(function (branch) { git.tag(function (tag) { res.json({ 'commit': commit, 'branch': branch, 'tag': tag }); }); }); }); };
它在我的本地机器上正常工作,但在heroku上,它只是返回
{ "commit": "", "branch": "", "tag": "" }
我的package.json
包含"git-rev": "~0.2.1"
作为依赖项,我无法在heroku日志中find提示。 为什么它不能在heroku上工作?