Last active
March 27, 2021 15:51
-
-
Save allomov/e9b7d4506c271a24e87d91371a323076 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function updateSubmodulesRecursevly(repository, cloneOptions) { | |
return repository.getSubmoduleNames().then(function(names) { | |
return names.reduce(function(promiseChain, name) { | |
return promiseChain.then(function() { | |
return new Promise(function(resolve, reject) { | |
Submodule.lookup(repository, name) | |
.then(function(submodule) { | |
return submodule.init(1) | |
.then(function(result) { | |
return submodule.update(1, cloneOptions) | |
}) | |
.then(function() { | |
let submoduleRepoPath = path.join(repository.workdir(), submodule.path()); | |
return Repository.open(submoduleRepoPath) | |
.then(function(submoduleRepository) { | |
return updateSubmodulesRecursevly(submoduleRepository, cloneOptions); | |
}) | |
}) | |
.then(resolve, reject) | |
}); | |
}); | |
}); | |
}, Promise.resolve()); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I get the following error on the call to
submodule.update
:'protos' exists and is not an empty directory
. However, if Icd
into the parent directory and rungit submodule update
it executes without any problems. Any chance you know what might be going on?