Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.
Swift cache-cleanercleanerclideveloper-toolsdisk-cleanupdisk-spaceduplicate-finderhomebrewliquid-glassmac-cleanermacosmacos-appmacos-golden-gatemacos-tahoemacos-tweaksswiftswiftuiterminal-themesuninstalluninstaller
Keep every .bin file out of Archives in File Search
Țugui Dragoșac596c1c0f05
diff --git a/Packages/PeelCore/Sources/PeelCore/Support/FileKind.swift b/Packages/PeelCore/Sources/PeelCore/Support/FileKind.swiftindex 21d0d651..a0e7ddfe 100644--- a/Packages/PeelCore/Sources/PeelCore/Support/FileKind.swift+++ b/Packages/PeelCore/Sources/PeelCore/Support/FileKind.swift@@ -22,7 +22,12 @@ public enum FileKind: String, Sendable, Hashable, CaseIterable {}var excludedTypes: [UTType] {- self == .documents ? [.sourceCode] : []+ switch self {+ case .documents: [.sourceCode]+ // macOS gives every `.bin` this type, and hardly any is an archive: most are firmware or a framework's data.+ case .archives: [UTType(importedAs: "com.apple.macbinary-archive")]+ default: []+ }}public func includes(_ type: UTType) -> Bool {diff --git a/Packages/PeelCore/Tests/PeelCoreTests/FileSearchTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/FileSearchTests.swiftindex 862d1109..9dfb3a91 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/FileSearchTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/FileSearchTests.swift@@ -167,6 +167,19 @@ struct FileSearchTests {#expect(FileKind.any.includes(swift))}+ @Test func archivesLeaveOutTheTypeMacOSGivesEveryBinFile() throws {+ let bin = try #require(UTType(filenameExtension: "bin"))++ #expect(bin.conforms(to: .archive))+ #expect(!FileKind.archives.includes(bin))+ #expect(FileKind.archives.includes(.zip))+ #expect(FileSearch.queryString(for: {+ var criteria = FileSearchCriteria()+ criteria.kind = .archives+ return criteria+ }()).contains(#"kMDItemContentTypeTree != "\#(bin.identifier)""#))+ }+/// Each path Spotlight returns is checked on the disk. Only regular files the removal guard allows are listed,/// files an app keeps in a Library folder come last, and the largest come first within each part.@Test func listsOnlyRegularFilesOutsideProtectedLocations() throws {