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.

Offer nothing in Finder once Peel is gone

Țugui Dragoș9cdccd13d385
diff --git a/PeelFinder/FinderExtension.swift b/PeelFinder/FinderExtension.swift
index 07dea686..01d891f0 100644
--- a/PeelFinder/FinderExtension.swift
+++ b/PeelFinder/FinderExtension.swift
@@ -11,7 +11,10 @@ final class FinderExtension: FIFinderSync {
}
override func menu(for menuKind: FIMenuKind) -> NSMenu? {
- guard menuKind == .contextualMenuForItems, selectedApplication != nil else { return nil }
+ // Once Peel is moved or deleted this process can run on, with no image to show and no app to open.
+ guard menuKind == .contextualMenuForItems, FileManager.default.fileExists(atPath: Bundle.main.bundlePath),
+ selectedApplication != nil
+ else { return nil }
let menu = NSMenu(title: "")
let item = menu.addItem(withTitle: String(localized: "Uninstall with Peel…"), action: #selector(openInPeel(_:)), keyEquivalent: "")
item.image = NSImage(resource: .peelGlyph)