Fix issue with placing app bundle in product directory if an existing build is there
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 11 Sep 2024 13:54:18 +0000 (21:54 +0800)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Thu, 12 Sep 2024 05:17:36 +0000 (05:17 +0000)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
admin/osx/mac-crafter/Sources/main.swift

index d4d49d389c2b0cbdd0c9a677c7a8e6480b93c0da..25e1d824c50673acc7464fb1b7935503d49f2a2f 100644 (file)
@@ -209,6 +209,9 @@ struct MacCrafter: ParsableCommand {
                 atPath: productPath, withIntermediateDirectories: true, attributes: nil
             )
         }
+        if fm.fileExists(atPath: "\(productPath)/\(appName).app") {
+            try fm.removeItem(atPath: "\(productPath)/\(appName).app")
+        }
         try fm.copyItem(atPath: clientAppDir, toPath: "\(productPath)/\(appName).app")
 
         print("Done!")