File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ public extension FileManager {
28
28
/// All folders with a `.bundle` extension.
29
29
case bundles
30
30
31
+ /// All folders with a `.bundle` extension excluding privacy manifest bundles.
32
+ case nonPrivacyBundles
33
+
31
34
/// A directory with an optional name. If name is `nil`, all directories will be matched.
32
35
case directories( name: String ? )
33
36
@@ -186,6 +189,13 @@ public extension FileManager {
186
189
if fileURL. pathExtension == " bundle " {
187
190
matches. append ( fileURL)
188
191
}
192
+ case . nonPrivacyBundles:
193
+ // The only thing of interest is the path extension being ".bundle", but not a privacy
194
+ // bundle.
195
+ if fileURL. pathExtension == " bundle " ,
196
+ !fileURL. lastPathComponent. hasSuffix ( " _Privacy.bundle " ) {
197
+ matches. append ( fileURL)
198
+ }
189
199
case . headers:
190
200
if fileURL. pathExtension == " h " {
191
201
matches. append ( fileURL)
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ extension ResourcesManager {
30
30
static func directoryContainsResources( _ dir: URL ) throws -> Bool {
31
31
// First search for any .bundle files.
32
32
let fileManager = FileManager . default
33
- let bundles = try fileManager. recursivelySearch ( for: . bundles , in: dir)
33
+ let bundles = try fileManager. recursivelySearch ( for: . nonPrivacyBundles , in: dir)
34
34
35
35
// Stop searching if there were any bundles found.
36
36
if !bundles. isEmpty { return true }
@@ -168,7 +168,7 @@ extension ResourcesManager {
168
168
to resourceDir: URL ,
169
169
keepOriginal: Bool = false ) throws -> [ URL ] {
170
170
let fileManager = FileManager . default
171
- let allBundles = try fileManager. recursivelySearch ( for: . bundles , in: dir)
171
+ let allBundles = try fileManager. recursivelySearch ( for: . nonPrivacyBundles , in: dir)
172
172
173
173
// If no bundles are found, return an empty array since nothing was done (but there wasn't an
174
174
// error).
You can’t perform that action at this time.
0 commit comments