From 495c85905e106866f494d332cb87695559d2ea8d Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 20 Jun 2024 18:20:26 +0800 Subject: [PATCH] Throw if codesign binary not found in mac crafter Signed-off-by: Claudio Cambra --- admin/osx/mac-crafter/Sources/main.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/admin/osx/mac-crafter/Sources/main.swift b/admin/osx/mac-crafter/Sources/main.swift index abc43b446c..e0c8372394 100644 --- a/admin/osx/mac-crafter/Sources/main.swift +++ b/admin/osx/mac-crafter/Sources/main.swift @@ -22,6 +22,7 @@ struct MacCrafter: ParsableCommand { enum MacCrafterError: Error { case failedEnumeration(String) + case environmentError(String) } @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 { 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( "brew",