Throw if codesign binary not found in mac crafter

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-06-20 18:20:26 +08:00 committed by Claudio Cambra
parent cec60201fb
commit 495c85905e

View file

@ -22,6 +22,7 @@ struct MacCrafter: ParsableCommand {
enum MacCrafterError: Error { enum MacCrafterError: Error {
case failedEnumeration(String) case failedEnumeration(String)
case environmentError(String)
} }
@Argument(help: "Path to the root directory of the Nextcloud Desktop Client git repository.") @Argument(help: "Path to the root directory of the Nextcloud Desktop Client git repository.")
@ -54,6 +55,12 @@ struct MacCrafter: ParsableCommand {
mutating func run() throws { mutating func run() throws {
print("Configuring build tooling.") print("Configuring build tooling.")
if let codeSignIdentity {
guard commandExists("codesign") else {
throw MacCrafterError.environmentError("codesign not found, cannot proceed.")
}
}
try installIfMissing("git", "xcode-select --install") try installIfMissing("git", "xcode-select --install")
try installIfMissing( try installIfMissing(
"brew", "brew",