diff --git a/admin/osx/mac-crafter/Sources/Utils/Codesign.swift b/admin/osx/mac-crafter/Sources/Utils/Codesign.swift index 7b4654762dd4f..12999abb5ed00 100644 --- a/admin/osx/mac-crafter/Sources/Utils/Codesign.swift +++ b/admin/osx/mac-crafter/Sources/Utils/Codesign.swift @@ -32,6 +32,10 @@ func isAppExtension(_ path: String) -> Bool { path.hasSuffix(".appex") } +func isExecutable(_ path: String) -> Bool { + FileManager.default.isExecutableFile(atPath: path) +} + func codesign(identity: String, path: String, options: String = defaultCodesignOptions) throws { print("Code-signing \(path)...") let command = "codesign -s \"\(identity)\" \(options) \"\(path)\"" @@ -53,7 +57,10 @@ func recursivelyCodesign( } for case let enumeratedItem as String in pathEnumerator { - guard isLibrary(enumeratedItem) || isAppExtension(enumeratedItem) else { continue } + guard isLibrary(enumeratedItem) || + isAppExtension(enumeratedItem) || + isExecutable(enumeratedItem) + else { continue } try codesign(identity: identity, path: "\(path)/\(enumeratedItem)") } }