From: Claudio Cambra Date: Thu, 20 Jun 2024 06:26:12 +0000 (+0800) Subject: Make codesigning throw in mac crafter X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~6^2~158 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1ec7d0bb87fd55738430bbbd0875621c70cce841;p=nextcloud-desktop.git Make codesigning throw in mac crafter Signed-off-by: Claudio Cambra --- diff --git a/admin/osx/mac-crafter/Sources/Utils/Codesign.swift b/admin/osx/mac-crafter/Sources/Utils/Codesign.swift index 78ea5af2e..e0d5e5cbf 100644 --- a/admin/osx/mac-crafter/Sources/Utils/Codesign.swift +++ b/admin/osx/mac-crafter/Sources/Utils/Codesign.swift @@ -14,15 +14,18 @@ import Foundation +enum CodeSigningError: Error { + case failedToCodeSign(String) +} + func codesign( identity: String, path: String, options: String = "--timestamp --force --preserve-metadata=entitlements --verbose=4 --options runtime" -) { +) throws { print("Code-signing \(path)...") let command = "codesign -s \"\(identity)\" \(options) \(path)" guard shell(command) == 0 else { - print("Failed to code-sign \(path).") - exit(1) + throw CodeSigningError.failedToCodeSign("Failed to code-sign \(path).") } }