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.

List only what Firebase's CLI keeps as caches, not the version it runs

Țugui Dragoșde3e987d5709
diff --git a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
index f44d37c9..a39c59ab 100644
--- a/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Developer/DeveloperCaches.swift
@@ -1092,8 +1092,13 @@ public enum DeveloperCaches {
Folder("Library/Preferences/netlify/deno-cli", .downloads, source: "https://github.com/netlify/build/blob/03ae88564579d2addfc82970d0b8583963f886aa/packages/edge-bundler/node/bridge.ts#L66"),
Folder("Library/Preferences/netlify/tunnel", .downloads, source: "https://github.com/netlify/cli/blob/7f1c866914f261e8d57c85763487db88bfb61440/src/utils/live-tunnel.ts#L86"),
]),
+ // The standalone CLI unpacks the version it runs in `tools` and `runtime` in the same folder, so only these go.
Definition(id: "firebase", name: "Firebase CLI", systemImage: "cloud", appBundleIdentifiers: [], folders: [
- Folder(".cache/firebase", .downloads, source: "https://github.com/firebase/firebase-tools/blob/7f7747228cc583ecdaf053ac44f238bffc77f6f0/src/emulator/downloadableEmulators.ts#L29-L30"),
+ Folder(".cache/firebase/emulators", .downloads, source: "https://github.com/firebase/firebase-tools/blob/7f7747228cc583ecdaf053ac44f238bffc77f6f0/src/emulator/downloadableEmulators.ts#L29-L30"),
+ Folder(".cache/firebase/extensions", .downloads, source: "https://github.com/firebase/firebase-tools/blob/7f7747228cc583ecdaf053ac44f238bffc77f6f0/src/emulator/extensionsEmulator.ts#L108-L110"),
+ Folder(".cache/firebase/crashlytics/buildtools", .downloads, source: "https://github.com/firebase/firebase-tools/blob/7f7747228cc583ecdaf053ac44f238bffc77f6f0/src/crashlytics/buildToolsJarHelper.ts#L11-L13"),
+ Folder(".cache/firebase/universal-maker", .downloads, source: "https://github.com/firebase/firebase-tools/blob/7f7747228cc583ecdaf053ac44f238bffc77f6f0/src/apphosting/universalMakerDownload.ts#L10"),
+ Folder(".cache/firebase/firebase-debug.log", .logs, source: "https://github.com/firebase/firebase-tools/blob/7f7747228cc583ecdaf053ac44f238bffc77f6f0/src/bin/mcp.ts#L101-L104"),
]),
// Virtual machines
// Docker Desktop's own logs. Its disk image, `Data/vms`, is Space's to show and never offered here.
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
index 96b6a03a..013ce64e 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/DeveloperCachesTests.swift
@@ -578,6 +578,24 @@ struct DeveloperCachesTests {
#expect(listed == Set(["Cask", "downloads", "go_cache"].map { "\(moved)/\($0)" }))
}
+ @Test func leavesTheVersionOfFirebasesCLIThatRunsToIt() async throws {
+ let directory = try TemporaryDirectory()
+ for path in [
+ "emulators/firestore.jar", "extensions/org.example/source.zip", "crashlytics/buildtools/tools.jar",
+ "universal-maker/maker", "firebase-debug.log", "tools/lib/node_modules/firebase-tools/package.json",
+ "runtime/node",
+ ] {
+ try directory.file(".cache/firebase/\(path)", bytes: 4_096)
+ }
+ let firebase = DeveloperCaches.definitions.filter { $0.id == "firebase" }
+
+ let found = await DeveloperCaches.scan(firebase, homeDirectory: directory.url, exclusions: .none)
+
+ #expect(found.flatMap(\.locations).map(\.url.lastPathComponent).sorted() == [
+ "buildtools", "emulators", "extensions", "firebase-debug.log", "universal-maker",
+ ])
+ }
+
@Test func findsTheMovedCacheOfAHomebrewThatReadsItsTaps() async throws {
let directory = try TemporaryDirectory()
let home = directory.url.appending(path: "home", directoryHint: .isDirectory)
@@ -669,6 +687,8 @@ struct DeveloperCachesTests {
"Library/Application Support/Oracle/Java/Deployment",
// Corepack keeps the package manager versions a person chose in `lastKnownGood.json` beside its downloads.
".cache/node/corepack",
+ // The standalone Firebase CLI unpacks the version it runs beside its downloads.
+ ".cache/firebase",
// Hex and Gleam keep a Hex account's key beside their packages; pub, RubyGems, rebar3, Stack, and opam
// what they installed; renv each project's library; the Dart analysis server each plug-in's state.
".hex", "Library/Caches/gleam/hex/hexpm", ".pub-cache", ".local/share/gem", ".cache/rebar3", ".stack", ".opam",