Skip to content

Commit

Permalink
Add ability to skip certain files in recursive codesign
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra authored and backportbot[bot] committed Nov 21, 2024
1 parent 59bfced commit 527ecb4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion admin/osx/mac-crafter/Sources/Utils/Codesign.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ func codesign(identity: String, path: String, options: String = defaultCodesignO
func recursivelyCodesign(
path: String,
identity: String,
options: String = defaultCodesignOptions
options: String = defaultCodesignOptions,
skip: [String] = []
) throws {
let fm = FileManager.default
guard let pathEnumerator = fm.enumerator(atPath: path) else {
Expand All @@ -71,6 +72,10 @@ func recursivelyCodesign(

for case let enumeratedItem as String in pathEnumerator {
let enumeratedItemPath = "\(path)/\(enumeratedItem)"
guard !skip.contains(enumeratedItemPath) else {
print("Skipping \(enumeratedItemPath)...")
continue
}
let isExecutableFile = try isExecutable(enumeratedItemPath)
guard isLibrary(enumeratedItem) || isAppExtension(enumeratedItem) || isExecutableFile else {
continue
Expand Down

0 comments on commit 527ecb4

Please sign in to comment.