mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 13:05:51 +03:00
Add flag to build pkg in mac-crafter
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
1c8b2ac4b5
commit
4438836ade
1 changed files with 8 additions and 3 deletions
|
@ -86,6 +86,9 @@ struct Build: ParsableCommand {
|
||||||
@Flag(help: "Run a full rebuild.")
|
@Flag(help: "Run a full rebuild.")
|
||||||
var fullRebuild = false
|
var fullRebuild = false
|
||||||
|
|
||||||
|
@Flag(help: "Create an installer package.")
|
||||||
|
var package = false
|
||||||
|
|
||||||
mutating func run() throws {
|
mutating func run() throws {
|
||||||
print("Configuring build tooling.")
|
print("Configuring build tooling.")
|
||||||
|
|
||||||
|
@ -175,6 +178,7 @@ struct Build: ParsableCommand {
|
||||||
|
|
||||||
let allOptionsString = craftOptions.map({ "--options \"\($0)\"" }).joined(separator: " ")
|
let allOptionsString = craftOptions.map({ "--options \"\($0)\"" }).joined(separator: " ")
|
||||||
|
|
||||||
|
let buildWorkPath = "\(buildPath)/\(craftTarget)/build"
|
||||||
let clientBuildDir = "\(buildPath)/\(craftTarget)/build/\(craftBlueprintName)"
|
let clientBuildDir = "\(buildPath)/\(craftTarget)/build/\(craftBlueprintName)"
|
||||||
if fullRebuild {
|
if fullRebuild {
|
||||||
do {
|
do {
|
||||||
|
@ -209,9 +213,10 @@ struct Build: ParsableCommand {
|
||||||
}
|
}
|
||||||
try fm.copyItem(atPath: clientAppDir, toPath: "\(productPath)/\(appName).app")
|
try fm.copyItem(atPath: clientAppDir, toPath: "\(productPath)/\(appName).app")
|
||||||
|
|
||||||
print("Placing Nextcloud Desktop Client in product directory...")
|
if package {
|
||||||
try fm.createDirectory(atPath: productPath, withIntermediateDirectories: true, attributes: nil)
|
let packagePath =
|
||||||
try fm.copyItem(atPath: clientAppDir, toPath: productPath)
|
try buildPackage(buildWorkPath: buildWorkPath, productPath: productPath)
|
||||||
|
}
|
||||||
|
|
||||||
print("Done!")
|
print("Done!")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue