Merge pull request #7537 from nextcloud/bugfix/exec-detection-mac-crafter

Do not treat bundles as executables in codesign check
This commit is contained in:
Claudio Cambra 2024-11-21 16:26:39 +08:00 committed by GitHub
commit 92d0dca614
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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 {