From d1cb170d9def2890a2a244f36b14ca90fcb665b7 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Mon, 5 Aug 2024 19:00:38 +0800 Subject: [PATCH] Only create product path's directory if it doesn't exist already Signed-off-by: Claudio Cambra --- admin/osx/mac-crafter/Sources/main.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/admin/osx/mac-crafter/Sources/main.swift b/admin/osx/mac-crafter/Sources/main.swift index 8df694f67d..d4d49d389c 100644 --- a/admin/osx/mac-crafter/Sources/main.swift +++ b/admin/osx/mac-crafter/Sources/main.swift @@ -203,8 +203,12 @@ struct MacCrafter: ParsableCommand { let clientAppDir = "\(clientBuildDir)/image-\(buildType)-master/\(appName).app" try codesignClientAppBundle(at: clientAppDir, withCodeSignIdentity: codeSignIdentity) - print("Placing Nextcloud Desktop Client in product directory...") - try fm.createDirectory(atPath: productPath, withIntermediateDirectories: true, attributes: nil) + print("Placing Nextcloud Desktop Client in \(productPath)...") + if !fm.fileExists(atPath: productPath) { + try fm.createDirectory( + atPath: productPath, withIntermediateDirectories: true, attributes: nil + ) + } try fm.copyItem(atPath: clientAppDir, toPath: "\(productPath)/\(appName).app") print("Done!")