Codesign all crafted plugins in mac crafter

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-06-20 14:27:37 +08:00 committed by Claudio Cambra
parent 1dbde98598
commit 82c46b7539

View file

@ -78,6 +78,17 @@ struct MacCrafter: ParsableCommand {
try codesign(identity: codeSignIdentity, path: libPath)
}
let craftPluginsDir = "\(currentDir)/\(craftTarget)/plugins"
guard let craftPluginsEnumerator = fm.enumerator(atPath: craftPluginsDir) else {
throw MacCrafterError.failedEnumeration("Failed to list craft plugins directory.")
}
for case let plugin as String in craftPluginsEnumerator {
let pluginPath = "\(craftPluginsDir)/\(plugin)"
guard plugin.hasSuffix(".dylib") || plugin.hasSuffix(".framework") else { continue }
try codesign(identity: codeSignIdentity, path: pluginPath)
}
print("Crafting Nextcloud Desktop Client...")
shell("\(craftCommand) --src-dir \(repoRootDir) nextcloud-client")
}