INNER CODE UNIT · JavaScript
errorAndAttemptOpen
nodegit/nodegit · guides/cloning/gh-two-factor/index.js:37
var errorAndAttemptOpen = function() {
return NodeGit.Repository.open(localPath);
};
// Once the repository has been cloned or opened, you can work with a returned
// `Git.Repository` instance.
cloneRepository.catch(errorAndAttemptOpen)
.then(function(repository) {
// Access any repository methods here.
console.log("Is the repository bare? %s", Boolean(repository.isBare()));
});