Skip to content

Commit 2d61c48

Browse files
authored
Git Submodule Support (#284)
* feat: add `--recurse-submodules` to `git clone` or `git checkout` commands * chore: adjust clone command for SHA versions to ensure submodules are checked out
1 parent 7bc67a0 commit 2d61c48

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Sources/MintKit/Mint.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ public class Mint {
310310

311311
if package.versionCouldBeSHA {
312312
// version is maybe a SHA, so we can't do a shallow clone
313-
cloneCommand = "git clone \(package.gitPath) \(package.repoPath) && cd \(package.repoPath) && git checkout \(package.version)"
313+
cloneCommand = "git clone \(package.gitPath) \(package.repoPath) && cd \(package.repoPath) && git checkout \(package.version) && git submodule update --init --recursive"
314314
} else {
315-
cloneCommand = "git clone --depth 1 -b \(package.version) \(package.gitPath) \(package.repoPath)"
315+
cloneCommand = "git clone --depth 1 --recurse-submodules -b \(package.version) \(package.gitPath) \(package.repoPath)"
316316
}
317317
try runPackageCommand(name: "Cloning \(package.namedVersion)",
318318
command: cloneCommand,

0 commit comments

Comments
 (0)