简体   繁体   中英

Nodegit cloning not working?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM