Allow setting custom git clone command in mac crafter
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Sat, 22 Jun 2024 08:41:40 +0000 (16:41 +0800)
committerClaudio Cambra <developer@claudiocambra.com>
Mon, 8 Jul 2024 07:41:45 +0000 (15:41 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
admin/osx/mac-crafter/Sources/main.swift

index c2d5b738cd37f9be46f30cb7db49277cd017720c..338298827d83d75faefe76be0bc6a94dac0d4f4e 100644 (file)
@@ -62,6 +62,9 @@ struct MacCrafter: ParsableCommand {
     var sparkleDownloadUrl =
         "https://github.com/sparkle-project/Sparkle/releases/download/1.27.3/Sparkle-1.27.3.tar.xz"
 
+    @Option(name: [.long], help: "Git clone command; include options such as depth.")
+    var gitCloneCommand = "git clone --depth=1"
+
     mutating func run() throws {
         print("Configuring build tooling.")
 
@@ -97,7 +100,7 @@ struct MacCrafter: ParsableCommand {
                 print("KDE Craft is already cloned.")
             } else {
                 print("Cloning KDE Craft...")
-                shell("git clone --depth=1 \(craftMasterGitUrl) \(craftMasterDir)")
+                shell("\(gitCloneCommand) \(craftMasterGitUrl) \(craftMasterDir)")
             }
 
             print("Configuring Nextcloud Desktop Client blueprints for KDE Craft...")