Skip to content

Commit

Permalink
Do not treat bundles as executables in codesign check
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Nov 21, 2024
1 parent 258ba6d commit da581e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion admin/osx/mac-crafter/Sources/Utils/Codesign.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit da581e2

Please sign in to comment.