Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Name the app a plug-in came with only when its identifier says so

Țugui Dragoș8ff97f9fca9d
diff --git a/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift b/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift
index 120cf2cf..9d8664ad 100644
--- a/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift
@@ -162,7 +162,8 @@ public enum Plugins {
/// The app a plug-in came with: an installed app that claims it surely, through the identifier it declares or,
/// for one that declares none, through its name, since a name its identifier doesn't back says nothing; else the
- /// app Peel saw go whose identifier it has, extends, or shares a maker with, as Orphaned Files lists it.
+ /// app Peel saw go whose identifier it has or extends, as Orphaned Files names it. Sharing a maker doesn't say
+ /// which app a plug-in came with, since a maker's plug-ins usually come on their own.
static func origin(
of url: URL, identifier: String?, claimants: [Claimant], goneApps: [RememberedApp]
) -> Plugin.Origin? {
@@ -180,8 +181,6 @@ public enum Plugins {
let gone = goneApps.first { app in
let own = app.bundleIdentifier.lowercased()
return plugIn == own || plugIn.hasPrefix(own + ".")
- } ?? goneApps.first { app in
- OrphanScanner.cameWithAnAppThatLeft(identifier, goneApps: [app.bundleIdentifier.lowercased()])
}
return gone.map { .goneApp(name: $0.name) }
}
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift
index 001d4a28..496e82d0 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift
@@ -125,6 +125,7 @@ struct PluginsTests {
#expect(origin("Compressor.component", nil) == .installedApp(name: "Compressor"))
#expect(origin("Compressor.component", "com.othervendor.compressor") == nil)
#expect(origin("Gone.component", "com.gonevendor.gone.au") == .goneApp(name: "Gone"))
+ #expect(origin("Other.component", "com.gonevendor.other") == nil, "sharing a maker says nothing of which app")
#expect(origin("Nobody.component", "org.nobody.thing") == nil)
}