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.

Count the empty saved-settings folder among what Peel deletes outright

Țugui Dragoș4ec142578fd9
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md
index 5fbb5de7..e21006d0 100644
--- a/ARCHITECTURE.md
+++ b/ARCHITECTURE.md
@@ -110,14 +110,15 @@ Take the most common case, uninstalling an app. Every other page follows the sam
A handful of ideas carry most of the weight. Each is enforced in one place and tested there.
- **The Trash, never deletion.** Nothing in Peel deletes anything of the user's; what it deletes outright is its own:
- its list of refusals, when `peel history --refused --clear` is asked to forget it, and the empty placeholder
- `TrashMover` makes to hold a name on a disk that cannot rename without replacing (exFAT), when the move it was made
- for fails. Four actions can't be undone by History, and each says so where it is confirmed: Homebrew's own uninstall
- and clean up, resetting an app's privacy permissions, and Force Quit for an app that is still open 10 seconds after
- Peel asked it to quit (`QuitBeforeRemoving`). Forgetting a preference domain happens only once its file is in the
- Trash, so putting the file back undoes it. Every `brew` call runs without Homebrew's automatic cleanup
- (`HOMEBREW_NO_INSTALL_CLEANUP`), so an upgrade never deletes on its own; when a `brew.env` file of the user's turns
- that back on (`Homebrew.overrides()`, from `brew config`), the Homebrew page says so and leaves upgrades to Terminal.
+ its list of refusals, when `peel history --refused --clear` is asked to forget it; the empty placeholder `TrashMover`
+ makes to hold a name on a disk that cannot rename without replacing (exFAT), when the move it was made for fails; and
+ the folder `PreferenceBackup` makes for a reset's saved settings, when saving fails while it is still empty. Four
+ actions can't be undone by History, and each says so where it is confirmed: Homebrew's own uninstall and clean up,
+ resetting an app's privacy permissions, and Force Quit for an app that is still open 10 seconds after Peel asked it to
+ quit (`QuitBeforeRemoving`). Forgetting a preference domain happens only once its file is in the Trash, so putting the
+ file back undoes it. Every `brew` call runs without Homebrew's automatic cleanup (`HOMEBREW_NO_INSTALL_CLEANUP`), so
+ an upgrade never deletes on its own; when a `brew.env` file of the user's turns that back on (`Homebrew.overrides()`,
+ from `brew config`), the Homebrew page says so and leaves upgrades to Terminal.
- **One guard.** `RemovalGuard` decides, for the app and the `peel` tool alike, whether an item may move. Its
list of what nothing can bring back lives in `ProtectedData`, in PeelPrivileged, so the helper applies the
same list without asking the app. The guard judges the item and not the spelling of its path: each rule is
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 199e23ba..84473726 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -12,14 +12,16 @@ from happening, and they are not up for negotiation.
recorded, so History can put it back; in the app it runs inside `QuitGuard.shared.run` from its first move until History
has it, and so does a Put Back, so that quitting waits for them. No code path in Peel deletes anything of the user's,
and a change that adds one won't be accepted. What Peel deletes outright is its own: its list of refusals, when
-`peel history --refused --clear` is asked to forget it, and the empty placeholder `TrashMover` makes to hold a name on a
-disk that cannot rename without replacing (exFAT), when the move it was made for fails. Four things Peel starts can't be
-undone by History, and each says so where the user confirms it: Homebrew's own uninstall and clean up, resetting an
-app's privacy permissions, and Force Quit for an app that is still open 10 seconds after Peel asked it to quit.
-`defaults delete` for an app's preferences runs only once their file is in the Trash, and a reset exports the domain
-first, so putting the file back undoes it; putting saved settings back clears a domain only once it has been saved as a
-copy of its own, and asks first. Every `brew` call runs with `HOMEBREW_NO_INSTALL_CLEANUP`, so an upgrade never cleans
-up on its own, and when a `brew.env` file turns that back on (`Homebrew.overrides()`), Peel leaves upgrades to Terminal.
+`peel history --refused --clear` is asked to forget it; the empty placeholder `TrashMover` makes to hold a name on a
+disk that cannot rename without replacing (exFAT), when the move it was made for fails; and the folder
+`PreferenceBackup` makes for a reset's saved settings, when saving fails while it is still empty. Four things Peel
+starts can't be undone by History, and each says so where the user confirms it: Homebrew's own uninstall and clean up,
+resetting an app's privacy permissions, and Force Quit for an app that is still open 10 seconds after Peel asked it to
+quit. `defaults delete` for an app's preferences runs only once their file is in the Trash, and a reset exports the
+domain first, so putting the file back undoes it; putting saved settings back clears a domain only once it has been
+saved as a copy of its own, and asks first. Every `brew` call runs with `HOMEBREW_NO_INSTALL_CLEANUP`, so an upgrade
+never cleans up on its own, and when a `brew.env` file turns that back on (`Homebrew.overrides()`), Peel leaves upgrades
+to Terminal.
## What you need
diff --git a/SAFETY.md b/SAFETY.md
index 584ffe59..6de7f101 100644
--- a/SAFETY.md
+++ b/SAFETY.md
@@ -131,7 +131,8 @@ themselves; on one that cannot, such as exFAT, Peel first takes the name with an
free name allows, and the move then replaces the placeholder.
What Peel deletes outright is only its own: its list of refusals, when `peel history --refused --clear` is asked to
-forget it, and such a placeholder, when the move it was made for fails.
+forget it; such a placeholder, when the move it was made for fails; and the folder it makes to save an app's settings
+before a reset, when saving fails before anything is written in it.
Four things Peel starts can't be undone by History, and Peel says so before you confirm each of them: Homebrew's own
uninstall and its clean ups (Clean Up, and clearing older or every download), which delete what they remove; resetting