alienator88 / Pearcleaner

A free, source-available and fair-code licensed mac app cleaner
https://itsalin.com/appInfo/?id=pearcleaner
Other
691 stars 17 forks source link

[FR] Automatically run Brew Uninstall if the uninstalled application is from homebrew #33

Closed apotenza92 closed 3 months ago

apotenza92 commented 3 months ago

Hi,

Thought of a potentially cool idea for this app that would make it unique.

Sometimes I use this app to uninstall apps that I had installed using homebrew (because homebrew's native uninstall doesn't do this sort of cleanup job).

After I uninstall using Pearcleaner I go and run the homebrew uninstall command anyway to make sure homebrew is aware that it's gone. As far as I know homebrew is basically doing nothing when I run this because the app is already uninstalled.

Would be really cool if Pearcleaner could detect if the app I uninstalled is from homebrew and then go ahead and do the homebrew uninstall after the Pearcleaner one.

alienator88 commented 3 months ago

Hey, that’s actually a cool idea! I've ran into that myself a few times. I can add a new toggle in the settings if someone would want to run this alongside the file removal function. I can have it run a brew uninstall with the —force flag which should wipe all the caches related to that app. I can probably have this added in sometime tomorrow.

apotenza92 commented 3 months ago

Amazing. Are caches wiped now by Pearcleaner?

Agree a toggle in settings for something like 'automatically run brew uninstall for brew applications' would be perfect.

Why do you think the force flag is needed? I'm not familiar with it.

alienator88 commented 3 months ago

If the caches in home brew contain either the app name or the bundle id in some form, it should find them. This would be more to get brew synced up so it knows the app was removed outside of brew. The force flag does the uninstall without prompting for confirmation which would be needed if I want to run that in the background.

alienator88 commented 3 months ago

Added in v3.1.0