Add option to set product path in mac-crafter

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-07-16 15:54:44 +08:00
parent b539861fcc
commit 73432d1dac

View file

@ -36,6 +36,9 @@ struct MacCrafter: ParsableCommand {
@Option(name: [.short, .long], help: "Path for build files to be written.")
var buildPath = "\(FileManager.default.currentDirectoryPath)/build"
@Option(name: [.short, .long], help: "Path for the final product to be put.")
var productPath = "\(FileManager.default.currentDirectoryPath)/product"
@Option(name: [.short, .long], help: "Architecture.")
var arch = "arm64"
@ -200,6 +203,10 @@ 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)
try fm.copyItem(atPath: clientAppDir, toPath: productPath)
print("Done!")
}
}