From 9025be29a477146923bcab0b5422f77cfde836ab Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Sat, 22 Jun 2024 22:55:17 +0800 Subject: [PATCH] When doing a full rebuild in mac crafter, delete old build folder Signed-off-by: Claudio Cambra --- admin/osx/mac-crafter/Sources/main.swift | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/admin/osx/mac-crafter/Sources/main.swift b/admin/osx/mac-crafter/Sources/main.swift index 4dec3941c..28df59486 100644 --- a/admin/osx/mac-crafter/Sources/main.swift +++ b/admin/osx/mac-crafter/Sources/main.swift @@ -162,7 +162,16 @@ struct MacCrafter: ParsableCommand { print("Crafting Nextcloud Desktop Client...") let allOptionsString = craftOptions.map({ "--options \"\($0)\"" }).joined(separator: " ") - + + let clientBuildDir = "\(buildPath)/\(craftTarget)/build/\(craftBlueprintName)" + if fullRebuild { + do { + try fm.removeItem(atPath: clientBuildDir) + } catch let error { + print("WARNING! Error removing build directory: \(error)") + } + } + let buildMode = fullRebuild ? "-i" : buildAppBundle ? "--compile --install" : "--compile" guard shell( "\(craftCommand) --buildtype \(buildType) \(buildMode) \(allOptionsString) \(craftBlueprintName)" @@ -177,9 +186,8 @@ struct MacCrafter: ParsableCommand { print("Code-signing Nextcloud Desktop Client libraries and frameworks...") - let craftBuildDir = "\(buildPath)/\(craftTarget)/build" - let clientAppDir = - "\(craftBuildDir)/\(craftBlueprintName)/image-\(buildType)-master/\(appName).app" + + let clientAppDir = "\(clientBuildDir)/image-\(buildType)-master/\(appName).app" try codesignClientAppBundle(at: clientAppDir, withCodeSignIdentity: codeSignIdentity) print("Done!") -- 2.30.2