Tag: node github

处理promise中的返回值nodejs

我已经在NodeJs中构build了这个函数, var Git = require('nodegit'); var fse = require('fs-extra'); var path = require('path'); var fs = require('fs'); var repoPath = 'D:\\sample' function gitCommitHistory(repoPath, callbackGitCommitHistory) { try { var open = Git.Repository.open; var commitList = []; open(repoPath) .then(function(repo) { return repo.getMasterCommit(); }) .then(function(firstCommitOnMaster) { var history = firstCommitOnMaster.history(); history.on("commit", function(commit) { if (commit === 'undefined') { […]