mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-25 14:36:01 +03:00
Make codesigning throw in mac crafter
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
41b62e2677
commit
1ec7d0bb87
1 changed files with 6 additions and 3 deletions
|
@ -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).")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue