Nodegit克隆不工作?

我正在尝试使用Nodegit插件将一些git repos 复制到名为“tmp”的目录中,这样我就可以对实际文件夹进行操作(将其上传到服务器)。 这是我的代码:

var git = require('nodegit'); var repos = [some https repo urls] var options = { remoteCallbacks: { certificateCheck: function() { return 1; } } }; for(i = 0; i<repos.length; i++){ git.Clone(repos[i], './tmp', options).catch(function(err) { console.error(err); } ); } 

它所做的只是在一瞬间创build一个名为“tmp”的空目录并将其删除。 我得到的错误是./tmp' exists and is not an empty directory (但它不存在?)和authentication required but no callback set 。 任何人都知道如何解决这些?

正如gitter中提到的@ johnhaley81,你应该在这里签出testing代码。 覆盖certificateCheck应该解决The SSL certificate is invalid错误。

./tmp错误是有意义的,因为你正试图将多个存储库克隆到同一个目录中。