Add offline flag to mac crafter
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Mon, 24 Jun 2024 11:41:28 +0000 (19: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 c845bc4a0009b8db040de36397f56c445c159ef3..2ae6379fa29aa6b1bf362ce22bf63d7e48ef809f 100644 (file)
@@ -64,6 +64,9 @@ struct MacCrafter: ParsableCommand {
     @Flag(help: "Reconfigure KDE Craft.")
     var reconfigureCraft = false
 
+    @Flag(help: "Run build offline (i.e. do not update craft)")
+    var offline = false
+
     @Flag(help: "Build test suite.")
     var buildTests = false
 
@@ -177,8 +180,9 @@ struct MacCrafter: ParsableCommand {
         }
 
         let buildMode = fullRebuild ? "-i" : disableAppBundle ? "compile" : "--compile --install"
+        let offlineMode = offline ? "--offline" : ""
         guard shell(
-            "\(craftCommand) --buildtype \(buildType) \(buildMode) \(allOptionsString) \(craftBlueprintName)"
+            "\(craftCommand) --buildtype \(buildType) \(buildMode) \(offlineMode) \(allOptionsString) \(craftBlueprintName)"
         ) == 0 else {
             throw MacCrafterError.craftError("Error crafting Nextcloud Desktop Client.")
         }