Make sure submodules added after first clone are initialized properly

This commit is contained in:
southerntofu 2022-01-09 15:59:27 +01:00
parent 38d85f954a
commit ad61faaecf
1 changed files with 13 additions and 1 deletions

View File

@ -233,7 +233,19 @@ impl Repo {
.expect("WTF")
.success()
{
// Main updates succeeded
// Main updates succeeded. If new submodules were added, initialize them
if !Command::new("git")
.arg("submodule")
.arg("update")
.arg("--init")
.arg("--recursive")
.status()
.expect("WTF")
.success()
{
// TODO: Should be forgebuild error message
eprintln!("Failed to initialize submodules which were added to the repo");
}
return true;
} else {
// Main updates failed, return true if there were some submodule updates