Do not treat bundles as executables in codesign check

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-11-21 16:24:52 +08:00
parent 258ba6da85
commit da581e2b0e
No known key found for this signature in database
GPG key ID: C839200C384636B0

View file

@ -33,7 +33,10 @@ func isAppExtension(_ path: String) -> Bool {
}
func isExecutable(_ path: String) -> Bool {
FileManager.default.isExecutableFile(atPath: path)
let fm = FileManager.default
var isDir: ObjCBool = false
let exists = fm.fileExists(atPath: path, isDirectory: &isDir)
return fm.isExecutableFile(atPath: path) && !isDir.boolValue && exists
}
func codesign(identity: String, path: String, options: String = defaultCodesignOptions) throws {