I'm trying to use the Nodegit plugin to clone some git repos into a directory called 'tmp' so I can do things with the actual folder (upload it to a server). Here's my code:
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); } );
}
All it does is create an empty directory called 'tmp' for a split second and deletes it. The errors I get are ./tmp' exists and is not an empty directory
(but it does not exist?) and authentication required but no callback set
. Anyone know how to fix these?
As @johnhaley81 mentioned in gitter, you should checkout the test code here. Overriding the certificateCheck
should resolve The SSL certificate is invalid
error.
The ./tmp
error makes sense, because you are trying to clone multiple repositories into the same directory.