diff --git a/Plogon/BuildProcessor.cs b/Plogon/BuildProcessor.cs index 36593d4..16cff75 100644 --- a/Plogon/BuildProcessor.cs +++ b/Plogon/BuildProcessor.cs @@ -812,14 +812,7 @@ public async Task ProcessTask(BuildTask task, bool commit, string? { }, null); repo.Reset(ResetMode.Hard, task.Manifest.Plugin.Commit); - - foreach (var submodule in repo.Submodules) - { - repo.Submodules.Update(submodule.Name, new SubmoduleUpdateOptions - { - Init = true, - }); - } + HandleSubmodules(repo); if (!await CheckIfTrueCommit(work, task.Manifest.Plugin.Commit)) throw new Exception("Commit in manifest is not a true commit, please don't specify tags"); @@ -1157,6 +1150,21 @@ private static void CopySourceForArchive(DirectoryInfo from, DirectoryInfo to, i } } + private static void HandleSubmodules(Repository repo) + { + foreach (var submodule in repo.Submodules) + { + repo.Submodules.Update(submodule.Name, new SubmoduleUpdateOptions + { + Init = true, + }); + + // In the case of recursive submodules + var submoduleRepo = new Repository(Path.Combine(repo.Info.WorkingDirectory, submodule.Path)); + HandleSubmodules(submoduleRepo); + } + } + /// /// Exception when repo commit fails ///