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.

Hold that a maker's files stay while another of its apps is installed

Țugui Dragoș18cae0454999
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swift
index 3d3e9386..40712aac 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/OrphanScannerTests.swift
@@ -635,6 +635,20 @@ struct OrphanScannerTests {
/// A group container is there for a maker's apps to share, so another app of that maker claims it as it claims
/// the maker's other files, with `group.` in front of the name or not.
+ @Test func aMakersInstallerFolderStaysWhileAnotherAppOfTheMakerIsInstalled() async throws {
+ let directory = try TemporaryDirectory()
+ try directory.file("home/Library/Application Support/org.example-maker.installer/state.db")
+ let editor = InstalledApp(
+ url: URL(filePath: "/Applications/Editor.app"), bundleIdentifier: "org.example-maker.editor", name: "Editor"
+ )
+
+ let withTheMaker = await scanner(in: directory).scan(installedApps: installed + [editor])
+ let withoutIt = await scanner(in: directory).scan(installedApps: installed)
+
+ #expect(withTheMaker.groups.isEmpty)
+ #expect(withoutIt.groups.map(\.identifier) == ["org.example-maker.installer"])
+ }
+
@Test func anotherAppOfTheMakerClaimsItsGroupContainer() async throws {
let directory = try TemporaryDirectory()
try directory.directory("home/Library/Group Containers/group.com.vendor.notes")