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.

Show the maker's folder in /Users/Shared when the app is the maker's last

Țugui Dragoș474fce46ba77
diff --git a/GUIDE.md b/GUIDE.md
index 5780957e..5138b83c 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -37,7 +37,8 @@ and how to get it, [SAFETY.md](SAFETY.md) what it protects, [PRIVACY.md](PRIVACY
back. What is named for another app of the same maker that macOS knows, such as a build Xcode keeps, is that app's
and isn't listed, and an identifier a tool gives apps whose makers set none, such as Electron's `com.electron.`
ones, ties no two apps to one maker. When no other app of its maker is installed, what the maker's own folder
- holds, such as `Application Support/Microsoft` for the last of Microsoft's apps, waits there too.
+ holds, such as `Application Support/Microsoft` for the last of Microsoft's apps, or `/Users/Shared/Epic Games` for
+ Epic's launcher, waits there too.
- **What only an administrator can move** stays where it is when Peel's helper isn't allowed to move it from there.
Once the app is gone, Peel says how many items stayed, and Orphaned Files lists them under Needs an Administrator,
with how to remove them in Finder.
diff --git a/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift b/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift
index bdc71dd9..89130434 100644
--- a/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Leftovers/LeftoverScanner.swift
@@ -262,7 +262,9 @@ public struct LeftoverScanner: Sendable {
)
}
- private static let makersPlaces: Set<SearchLocation.Kind> = [.applicationSupport, .caches, .logs, .library]
+ private static let makersPlaces: Set<SearchLocation.Kind> = [
+ .applicationSupport, .caches, .logs, .library, .sharedFolder,
+ ]
/// What the maker's own folders hold while the app is the maker's last: the folder whole when no row is in it,
/// else each item in it that is no row and holds none. Shown, never selected: the maker may have put there what
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift
index cda8ff70..65cefff5 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift
@@ -1907,6 +1907,30 @@ struct LeftoverScannerTests {
#expect(Set(beside.keys) == ["Application Support/AcmeCorp/Tidewater Studio"])
}
+ @Test func showsTheMakersFolderEveryAccountSharesWhenItIsTheMakersLastApp() async throws {
+ let directory = try TemporaryDirectory()
+ let launcher = InstalledApp(
+ url: URL(filePath: "/Applications/Tidewater Launcher.app"), bundleIdentifier: "net.acmecorp.launcher",
+ name: "Tidewater Launcher", developer: "AcmeCorp Ltd"
+ )
+ let paint = InstalledApp(
+ url: URL(filePath: "/Applications/Paint.app"), bundleIdentifier: "net.acmecorp.paint", name: "Paint"
+ )
+ try directory.file("root/Users/Shared/AcmeCorp/Tidewater Quest/Quest.app/Contents/Info.plist", bytes: 64)
+ let shared = directory.url.appending(path: "root/Users/Shared/AcmeCorp").path(percentEncoded: false)
+ func found(beside others: [InstalledApp]) async -> Leftover? {
+ let scan = await LeftoverScanner(environment: environment(in: directory)).scan(
+ launcher, installedApps: [launcher] + others
+ )
+ return scan.leftovers.first { PathPattern.comparablePath(of: $0.url) == shared }
+ }
+
+ let alone = try #require(await found(beside: []))
+ #expect(alone.match.reason == .inItsMakersFolder && alone.match.confidence == .possible)
+ #expect(alone.match.heldBack == .sharedWithEveryone && !alone.match.isRecommended)
+ #expect(await found(beside: [paint]) == nil)
+ }
+
/// A kernel extension an app's driver installed stays in `/Library/Extensions` after the app goes. It is found by
/// the identifier it declares and listed, but only an administrator can move it and Peel's helper does not serve
/// that folder, so it can never be selected.