From 4438836ade03dc5a0df066dbba038aac0b0c2aac Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 19 Sep 2024 21:00:15 +0800 Subject: [PATCH] Add flag to build pkg in mac-crafter Signed-off-by: Claudio Cambra --- admin/osx/mac-crafter/Sources/main.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/admin/osx/mac-crafter/Sources/main.swift b/admin/osx/mac-crafter/Sources/main.swift index dbf527222..1efe1e992 100644 --- a/admin/osx/mac-crafter/Sources/main.swift +++ b/admin/osx/mac-crafter/Sources/main.swift @@ -86,6 +86,9 @@ struct Build: ParsableCommand { @Flag(help: "Run a full rebuild.") var fullRebuild = false + @Flag(help: "Create an installer package.") + var package = false + mutating func run() throws { print("Configuring build tooling.") @@ -175,6 +178,7 @@ struct Build: ParsableCommand { let allOptionsString = craftOptions.map({ "--options \"\($0)\"" }).joined(separator: " ") + let buildWorkPath = "\(buildPath)/\(craftTarget)/build" let clientBuildDir = "\(buildPath)/\(craftTarget)/build/\(craftBlueprintName)" if fullRebuild { do { @@ -209,9 +213,10 @@ struct Build: ParsableCommand { } try fm.copyItem(atPath: clientAppDir, toPath: "\(productPath)/\(appName).app") - print("Placing Nextcloud Desktop Client in product directory...") - try fm.createDirectory(atPath: productPath, withIntermediateDirectories: true, attributes: nil) - try fm.copyItem(atPath: clientAppDir, toPath: productPath) + if package { + let packagePath = + try buildPackage(buildWorkPath: buildWorkPath, productPath: productPath) + } print("Done!") }