Only create product path's directory if it doesn't exist already

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-08-05 19:00:38 +08:00 committed by Camila Ayres
parent 3588c139b8
commit d1cb170d9d

View File

@ -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!")