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.

Say ahead what Remove Peel can't do, and keep what App Folders no longer reads

Țugui Dragoș114655fe635a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c6a03f17..dc1d01bd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,7 +20,8 @@ its changes the way [Keep a Changelog](https://keepachangelog.com/) suggests.
and comes back when you open Peel again from the menu bar, Finder, or Spotlight.
- Under Watch the Trash and the disk warning, Settings says when macOS doesn't let Peel send notifications, with Open
System Settings.
-- On a standard account, Settings gives a line to add to `~/.zshrc` that runs Peel's own `peel`, with Copy.
+- On a standard account, Settings gives a line to add to your shell's startup file that runs Peel's own `peel`, with
+ Copy.
- Uninstall Helper is offered while the helper waits for approval too, and asks first, since the helper serves every
account.
@@ -322,8 +323,8 @@ its changes the way [Keep a Changelog](https://keepachangelog.com/) suggests.
over, also to VoiceOver.
- App Folders says its list can't be read as soon as a reading of the apps finds it so, and starting it over anywhere
clears the notice on every page.
-- The login item and the Finder extension read Checking until macOS answers, and the Helper tab says when another copy
- of Peel installed the helper.
+- The login item's switch stays off, and the Finder extension reads Checking, until macOS answers, and the Helper tab
+ says when another copy of Peel installed the helper.
- Check for app updates checks at once whichever tab turns it on.
- `peel exclusions` notes a path that isn't there yet and counts only what went on the list.
- A `brew` chosen in Settings that can't be run is never replaced by another, and a `brew` where Homebrew installs
diff --git a/GUIDE.md b/GUIDE.md
index 33ce613b..b452b501 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -380,8 +380,8 @@ when you open Peel again from the menu bar, Finder, or Spotlight.
- **Getting it.** The command ships inside Peel. Settings > General shows, beside Command-line tool, the command
that puts it on your path: copy it and run it in Terminal, which asks for your password. It runs `sudo`, so on a
- standard account Peel says it needs an administrator, and gives instead a line to add to `~/.zshrc`, which runs the
- command from that account alone. A Homebrew install puts it there for you.
+ standard account Peel says it needs an administrator, and gives instead a line to add to your shell's startup file,
+ `~/.zshrc`, `~/.bash_profile`, or fish's `config.fish`, which runs the command from that account alone. A Homebrew install puts it there for you.
- **It asks first.** Every command that moves something shows its plan and asks before it moves anything.
`--dry-run` only shows the plan, and `-y` skips the question.
- **Only when you can answer.** It asks only in a terminal where you can see the plan and type, so with its output
@@ -450,9 +450,10 @@ In Settings > General, choose Remove Peel. Peel then:
exclusions, App Folders, and the settings Peel saved when you reset an app, among others;
- ends its Finder extension, takes its icon out of the Dock, clears its settings, and quits.
-Remove Peel takes no step while Peel itself can't move, such as from a folder only an administrator can change, or
-from the copy macOS runs while Peel is still marked as downloaded, or from its disk image: move Peel to the
-Applications folder, open it there, and choose Remove Peel. And while its helper is installed, only an
+Remove Peel takes no step, and says so before you choose it, while Peel itself can't move. From a folder only an
+administrator can change, log in as an administrator and choose it there, or drag Peel to the Trash in Finder, which
+asks for one. From the copy macOS runs while Peel is still marked as downloaded, or from its disk image, move Peel to
+the Applications folder, open it there, and choose Remove Peel. And while its helper is installed, only an
administrator's account can remove it, so from another account Peel stays where it is.
If you dragged Peel to the Trash instead, its helper stays registered: System Settings > General > Login Items &
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstrings
index fe2181d8..a7e130d7 100644
--- a/Localization/Peel/Localizable.xcstrings
+++ b/Localization/Peel/Localizable.xcstrings
@@ -135107,7 +135107,7 @@
"ro" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel nu mută niciodată în Coș nimic din interiorul acestora și nici un dosar care conține unul dintre ele, iar le omite din listele sale, cu excepția paginii Toate aplicațiile, care marchează ca exclusă o aplicație din interiorul acestora, și a paginii Homebrew, care nu dezinstalează niciun pachet din interiorul acestora. Istoricul arată în continuare ce a fost mutat înainte. „Curățați” din pagina Homebrew păstrează formulele ale căror dosare le excludeți aici, dar această listă nu acoperă ce altceva șterge comanda, cum ar fi descărcările Homebrew."
+ "value" : "Peel nu mută niciodată în Coș nimic din interiorul acestora și nici un dosar care conține unul dintre ele, și le lasă în afara listelor sale, cu excepția paginii Toate aplicațiile, care marchează ca exclusă o aplicație din interiorul acestora, și a paginii Homebrew, care nu dezinstalează niciun pachet din interiorul acestora. Istoricul arată în continuare ce a fost mutat înainte. „Curățați” din pagina Homebrew păstrează formulele ale căror dosare le excludeți aici, dar această listă nu acoperă ce altceva șterge comanda, cum ar fi descărcările Homebrew."
}
},
"ru" : {
@@ -135360,6 +135360,112 @@
}
}
},
+ "Peel no longer looks in these folders, so the apps in them aren’t listed." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel už v těchto složkách nehledá, takže aplikace v nich se neuvádějí."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel sucht nicht mehr in diesen Ordnern, daher werden die Apps darin nicht aufgeführt."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel ya no busca en estas carpetas, así que las apps que contienen no aparecen en la lista."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel ne regarde plus dans ces dossiers : les apps qu’ils contiennent ne sont donc pas listées."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel non cerca più in queste cartelle, quindi le app che contengono non vengono elencate."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peelはこれらのフォルダを調べなくなったため、中にあるアプリは一覧に表示されません。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel이 이 폴더들을 더 이상 살펴보지 않으므로 그 안에 있는 앱은 목록에 표시되지 않습니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel kijkt niet meer in deze mappen, dus de apps daarin worden niet getoond."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel nie szuka już w tych folderach, więc znajdujących się w nich aplikacji nie ma na liście."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "O Peel não procura mais nestas pastas, então os apps que estão nelas não são listados."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel nu mai caută în aceste dosare, așa că aplicațiile din ele nu sunt listate."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel больше не ищет в этих папках, поэтому находящиеся в них приложения не показываются в списке."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel letar inte längre i de här mapparna, så apparna i dem listas inte."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel artık bu klasörlere bakmıyor, bu yüzden içlerindeki uygulamalar listelenmiyor."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel більше не шукає в цих папках, тож програми в них не показуються."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel已不再查看这些文件夹,因此不会列出其中的App。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel已不再查看這些檔案夾,因此不會列出其中的App。"
+ }
+ }
+ }
+ },
"Peel on GitHub" : {
"localizations" : {
"cs" : {
@@ -138228,108 +138334,108 @@
}
}
},
- "Peel won’t move itself from here: its folder needs an administrator. Drag it to the Trash in Finder, which asks for an administrator." : {
+ "Peel won’t move itself from here: its folder needs an administrator. Log in as an administrator and choose Remove Peel there, or drag it to the Trash in Finder, which asks for one." : {
"localizations" : {
"cs" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel se odsud sám nepřesune: jeho složka vyžaduje oprávnění správce. Přetáhněte ho do koše ve Finderu, který požádá o údaje správce."
+ "value" : "Peel se odsud sám nepřesune: jeho složka vyžaduje oprávnění správce. Přihlaste se jako správce a tam zvolte „Odstranit Peel“, nebo ho přetáhněte do koše ve Finderu, který požádá o údaje správce."
}
},
"de" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel verschiebt sich von hier aus nicht selbst: Der Ordner, in dem Peel liegt, erfordert einen Administrator. Ziehe Peel im Finder in den Papierkorb. Der Finder fragt nach einem Administrator."
+ "value" : "Peel verschiebt sich von hier aus nicht selbst: Der Ordner, in dem Peel liegt, erfordert einen Administrator. Melde dich als Administrator an und wähle dort „Peel entfernen“, oder ziehe Peel im Finder in den Papierkorb. Der Finder fragt nach einem Administrator."
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel no se trasladará a sí mismo desde aquí: su carpeta necesita un administrador. Arrástralo a la papelera en el Finder, que pide un administrador."
+ "value" : "Peel no se trasladará a sí mismo desde aquí: su carpeta necesita un administrador. Inicia sesión como administrador y elige “Eliminar Peel” allí, o arrástralo a la papelera en el Finder, que pide un administrador."
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel refuse de se placer dans la corbeille depuis cet emplacement : son dossier nécessite un administrateur. Faites-le glisser dans la corbeille depuis le Finder, qui demande l’autorisation d’un administrateur."
+ "value" : "Peel refuse de se placer dans la corbeille depuis cet emplacement : son dossier nécessite un administrateur. Ouvrez une session en tant qu’administrateur et choisissez « Supprimer Peel » dans cette session, ou faites glisser Peel dans la corbeille depuis le Finder, qui demande l’autorisation d’un administrateur."
}
},
"it" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Da qui Peel non sposta sé stesso: la sua cartella richiede un amministratore. Trascinalo nel Cestino dal Finder, che chiede l’autorizzazione di un amministratore."
+ "value" : "Da qui Peel non sposta sé stesso: la sua cartella richiede un amministratore. Esegui il login come amministratore e scegli “Rimuovi Peel” da lì, oppure trascinalo nel Cestino dal Finder, che chiede l’autorizzazione di un amministratore."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peelはここから自身を移動しません。Peelがあるフォルダでは管理者の権限が必要なためです。Finderでゴミ箱にドラッグしてください。その際、Finderが管理者の認証を求めます。"
+ "value" : "Peelはここから自身を移動しません。Peelがあるフォルダでは管理者の権限が必要なためです。管理者としてログインし、そこで“Peelをアンインストール”を選択するか、Finderでゴミ箱にドラッグしてください。その際、Finderが管理者の認証を求めます。"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel은 이 위치에서 자신을 이동하지 않습니다. Peel이 있는 폴더에 관리자 권한이 필요하기 때문입니다. Finder에서 Peel을 휴지통으로 드래그하십시오. Finder가 관리자 인증을 요청합니다."
+ "value" : "Peel은 이 위치에서 자신을 이동하지 않습니다. Peel이 있는 폴더에 관리자 권한이 필요하기 때문입니다. 관리자로 로그인한 다음 그곳에서 ‘Peel 제거’를 선택하거나, Finder에서 Peel을 휴지통으로 드래그하십시오. Finder가 관리자 인증을 요청합니다."
}
},
"nl" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel verplaatst zichzelf niet vanaf deze plek: voor de map is een beheerder nodig. Sleep Peel in Finder naar de prullenmand, dan vraagt Finder om een beheerder."
+ "value" : "Peel verplaatst zichzelf niet vanaf deze plek: voor de map is een beheerder nodig. Log in als beheerder en kies daar 'Verwijder Peel', of sleep Peel in Finder naar de prullenmand, dan vraagt Finder om een beheerder."
}
},
"pl" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel nie przeniesie się sam do Kosza z tego miejsca: jego folder wymaga uprawnień administratora. Przeciągnij go do Kosza w Finderze, który poprosi o dane administratora."
+ "value" : "Peel nie przeniesie się sam do Kosza z tego miejsca: jego folder wymaga uprawnień administratora. Zaloguj się jako administrator i tam wybierz „Odinstaluj Peel” albo przeciągnij go do Kosza w Finderze, który poprosi o dane administratora."
}
},
"pt" : {
"stringUnit" : {
"state" : "translated",
- "value" : "O Peel não vai se mover daqui: a pasta dele requer um administrador. Arraste-o para o Lixo no Finder, que pede um administrador."
+ "value" : "O Peel não vai se mover daqui: a pasta dele requer um administrador. Inicie sessão como administrador e escolha “Remover o Peel” lá, ou arraste-o para o Lixo no Finder, que pede um administrador."
}
},
"ro" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel nu se mută singur de aici: dosarul său necesită un administrator. Trageți‑l în Coș din Finder, care cere un administrator."
+ "value" : "Peel nu se mută singur de aici: dosarul său necesită un administrator. Faceți login ca administrator și alegeți „Eliminați Peel” de acolo sau trageți‑l în Coș din Finder, care cere un administrator."
}
},
"ru" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel не будет перемещать себя отсюда: для его папки нужен администратор. Перетащите его в Корзину в Finder: Finder запросит данные администратора."
+ "value" : "Peel не будет перемещать себя отсюда: для его папки нужен администратор. Войдите как администратор и выберите там «Удалить Peel» или перетащите его в Корзину в Finder: Finder запросит данные администратора."
}
},
"sv" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel flyttar inte sig själv härifrån: mappen kräver en administratör. Dra Peel till papperskorgen i Finder, som ber om en administratör."
+ "value" : "Peel flyttar inte sig själv härifrån: mappen kräver en administratör. Logga in som administratör och välj ”Ta bort Peel” där, eller dra Peel till papperskorgen i Finder, som ber om en administratör."
}
},
"tr" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel kendini buradan taşımaz: bulunduğu klasör bir yönetici gerektiriyor. Onu Finder’da Çöp Sepeti’ne sürükleyin; Finder yönetici ister."
+ "value" : "Peel kendini buradan taşımaz: bulunduğu klasör bir yönetici gerektiriyor. Yönetici olarak oturum açın ve orada “Peel’i Kaldır” düğmesini tıklayın ya da onu Finder’da Çöp Sepeti’ne sürükleyin; Finder yönetici ister."
}
},
"uk" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel не перемістить себе звідси: змінювати її папку може лише адміністратор. Перетягніть Peel у Смітник у Finder: Finder попросить дані адміністратора."
+ "value" : "Peel не перемістить себе звідси: змінювати її папку може лише адміністратор. Увійдіть як адміністратор і виберіть там «Вилучити Peel» або перетягніть Peel у Смітник у Finder, який попросить дані адміністратора."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel不会从此处移动自己:它所在的文件夹需要管理员权限。请在“访达”中将它拖到废纸篓,“访达”会要求管理员授权。"
+ "value" : "Peel不会从此处移动自己:它所在的文件夹需要管理员权限。请以管理员身份登录,然后在那里选取“移除Peel”;或者在“访达”中将它拖到废纸篓,“访达”会要求管理员授权。"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Peel不會從這裡移動自己:它所在的檔案夾需要管理者權限。請在Finder中將它拖到「垃圾桶」,Finder會要求管理者驗證。"
+ "value" : "Peel不會從這裡移動自己:它所在的檔案夾需要管理者權限。請以管理者身分登入,並在那裡選擇「移除Peel」,或在Finder中將它拖到「垃圾桶」,Finder會要求管理者驗證。"
}
}
}
@@ -146696,109 +146802,108 @@
}
}
},
- "Putting `peel` on the path takes an administrator. To use it from this account, add this line to ~/.zshrc, then open a new Terminal window." : {
- "comment" : "In Settings > General, above a line of shell code to copy, on an account that is not an administrator's. Keep `peel` and ~/.zshrc as they are.",
+ "Putting `peel` on the path takes an administrator. To use it from this account, add this line to %@, then open a new Terminal window." : {
"localizations" : {
"cs" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Aby byl příkaz `peel` dostupný přes PATH, je potřeba správce. Chcete-li ho používat z tohoto účtu, přidejte tento řádek do souboru ~/.zshrc a pak otevřete nové okno Terminálu."
+ "value" : "Aby byl příkaz `peel` dostupný přes PATH, je potřeba správce. Chcete-li ho používat z tohoto účtu, přidejte tento řádek do souboru %@ a pak otevřete nové okno Terminálu."
}
},
"de" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Um `peel` in den Suchpfad aufzunehmen, wird ein Administrator benötigt. Wenn du es mit diesem Benutzeraccount verwenden möchtest, füge diese Zeile zu ~/.zshrc hinzu und öffne dann ein neues Terminal-Fenster."
+ "value" : "Um `peel` in den Suchpfad aufzunehmen, wird ein Administrator benötigt. Wenn du es mit diesem Benutzeraccount verwenden möchtest, füge diese Zeile zu %@ hinzu und öffne dann ein neues Terminal-Fenster."
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Para poner `peel` en el PATH hace falta un administrador. Si quieres usarlo desde esta cuenta, añade esta línea a ~/.zshrc y, después, abre una ventana nueva de Terminal."
+ "value" : "Para poner `peel` en el PATH hace falta un administrador. Si quieres usarlo desde esta cuenta, añade esta línea a %@ y, después, abre una ventana nueva de Terminal."
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Placer `peel` dans le PATH nécessite un administrateur. Pour l’utiliser depuis ce compte, ajoutez cette ligne au fichier ~/.zshrc, puis ouvrez une nouvelle fenêtre de Terminal."
+ "value" : "Placer `peel` dans le PATH nécessite un administrateur. Pour l’utiliser depuis ce compte, ajoutez cette ligne au fichier %@, puis ouvrez une nouvelle fenêtre de Terminal."
}
},
"it" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Per inserire `peel` nel PATH serve un amministratore. Per usarlo da questo account, aggiungi questa riga al file ~/.zshrc, poi apri una nuova finestra di Terminale."
+ "value" : "Per inserire `peel` nel PATH serve un amministratore. Per usarlo da questo account, aggiungi questa riga al file %@, poi apri una nuova finestra di Terminale."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "`peel`をPATHの通った場所に置くには、管理者が必要です。このアカウントから使用するには、この行を~/.zshrcに追加してから、ターミナルで新規ウインドウを開いてください。"
+ "value" : "`peel`をPATHの通った場所に置くには、管理者が必要です。このアカウントから使用するには、この行を%@に追加してから、ターミナルで新規ウインドウを開いてください。"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "`peel`을 PATH에 추가하려면 관리자가 필요합니다. 이 계정에서 사용하려면 이 줄을 ~/.zshrc에 추가한 다음, 새로운 터미널 윈도우를 여십시오."
+ "value" : "`peel`을 PATH에 추가하려면 관리자가 필요합니다. 이 계정에서 사용하려면 이 줄을 %@에 추가한 다음, 새로운 터미널 윈도우를 여십시오."
}
},
"nl" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Om `peel` aan het zoekpad toe te voegen, is een beheerder nodig. Als je het vanuit deze account wilt gebruiken, voeg je deze regel toe aan ~/.zshrc en open je daarna een nieuw Terminal-venster."
+ "value" : "Om `peel` aan het zoekpad toe te voegen, is een beheerder nodig. Als je het vanuit deze account wilt gebruiken, voeg je deze regel toe aan %@ en open je daarna een nieuw Terminal-venster."
}
},
"pl" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Dodanie `peel` do zmiennej PATH wymaga administratora. Aby używać go z tego konta, dodaj ten wiersz do pliku ~/.zshrc, a następnie otwórz nowe okno Terminala."
+ "value" : "Dodanie `peel` do zmiennej PATH wymaga administratora. Aby używać go z tego konta, dodaj ten wiersz do pliku %@, a następnie otwórz nowe okno Terminala."
}
},
"pt" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Colocar o `peel` no PATH requer um administrador. Para usá-lo a partir desta conta, adicione esta linha ao ~/.zshrc e depois abra uma nova janela do Terminal."
+ "value" : "Colocar o `peel` no PATH requer um administrador. Para usá-lo a partir desta conta, adicione esta linha ao %@ e depois abra uma nova janela do Terminal."
}
},
"ro" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Pentru a adăuga `peel` în PATH este nevoie de un administrator. Ca să‑l folosiți din acest cont, adăugați această linie în ~/.zshrc, apoi deschideți o fereastră nouă în Terminal."
+ "value" : "Pentru a adăuga `peel` în PATH este nevoie de un administrator. Ca să‑l folosiți din acest cont, adăugați această linie în %@, apoi deschideți o fereastră nouă în Terminal."
}
},
"ru" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Поместить `peel` в PATH может только администратор. Чтобы запускать его из этой учетной записи, добавьте эту строку в ~/.zshrc, а затем откройте новое окно Терминала."
+ "value" : "Поместить `peel` в PATH может только администратор. Чтобы запускать его из этой учетной записи, добавьте эту строку в %@, а затем откройте новое окно Терминала."
}
},
"sv" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Det krävs en administratör för att lägga till `peel` i sökvägen. Om du vill använda det från det här kontot lägger du till den här raden i ~/.zshrc och öppnar sedan ett nytt Terminal-fönster."
+ "value" : "Det krävs en administratör för att lägga till `peel` i sökvägen. Om du vill använda det från det här kontot lägger du till den här raden i %@ och öppnar sedan ett nytt Terminal-fönster."
}
},
"tr" : {
"stringUnit" : {
"state" : "translated",
- "value" : "`peel` aracını komut arama yoluna eklemek için bir yönetici gerekir. Onu bu hesaptan kullanmak için bu satırı ~/.zshrc dosyasına ekleyin, ardından yeni bir Terminal penceresi açın."
+ "value" : "`peel` aracını komut arama yoluna eklemek için bir yönetici gerekir. Onu bu hesaptan kullanmak için bu satırı %@ dosyasına ekleyin, ardından yeni bir Terminal penceresi açın."
}
},
"uk" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Додати `peel` до PATH може лише адміністратор. Щоб користуватися ним із цього облікового запису, додайте цей рядок до ~/.zshrc, а потім відкрийте нове вікно Термінала."
+ "value" : "Додати `peel` до PATH може лише адміністратор. Щоб користуватися ним із цього облікового запису, додайте цей рядок до %@, а потім відкрийте нове вікно Термінала."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "将`peel`放到PATH中需要管理员。若要在此账户中使用它,请将这一行添加到~/.zshrc,然后打开一个新的“终端”窗口。"
+ "value" : "将`peel`放到PATH中需要管理员。若要在此账户中使用它,请将这一行添加到%@,然后打开一个新的“终端”窗口。"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
- "value" : "將`peel`加入PATH需要管理者。若要從此帳號使用它,請將這一行加入~/.zshrc,然後打開新的「終端機」視窗。"
+ "value" : "將`peel`加入PATH需要管理者。若要從此帳號使用它,請將這一行加入%@,然後打開新的「終端機」視窗。"
}
}
}
@@ -146909,108 +147014,108 @@
}
}
},
- "Putting it on the path takes an administrator, and Peel’s Settings gives a line for ~/.zshrc that runs it from this account." : {
+ "Putting it on the path takes an administrator, and Peel’s Settings gives a line for your shell that runs it from this account." : {
"localizations" : {
"cs" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Aby byl dostupný přes PATH, je potřeba správce, a Nastavení Peelu nabízí řádek pro soubor ~/.zshrc, díky kterému ho můžete spouštět z tohoto účtu."
+ "value" : "Aby byl dostupný přes PATH, je potřeba správce, a Nastavení Peelu nabízí pro váš shell řádek, díky kterému ho můžete spouštět z tohoto účtu."
}
},
"de" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Um das Tool in den Suchpfad aufzunehmen, wird ein Administrator benötigt, und die Peel-Einstellungen bieten eine Zeile für ~/.zshrc, über die du es mit diesem Benutzeraccount verwenden kannst."
+ "value" : "Um das Tool in den Suchpfad aufzunehmen, wird ein Administrator benötigt, und die Peel-Einstellungen bieten eine Zeile für deine Shell, über die du es mit diesem Benutzeraccount verwenden kannst."
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Para ponerla en el PATH hace falta un administrador, y los ajustes de Peel ofrecen una línea para ~/.zshrc que permite ejecutarla desde esta cuenta."
+ "value" : "Para ponerla en el PATH hace falta un administrador, y los ajustes de Peel ofrecen una línea para tu shell que permite ejecutarla desde esta cuenta."
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Le placer dans le PATH nécessite un administrateur, et les Réglages de Peel fournissent une ligne à ajouter au fichier ~/.zshrc pour l’exécuter depuis ce compte."
+ "value" : "Le placer dans le PATH nécessite un administrateur, et les Réglages de Peel fournissent une ligne pour votre shell afin de l’exécuter depuis ce compte."
}
},
"it" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Per inserirlo nel PATH serve un amministratore, e nelle Impostazioni di Peel trovi una riga per il file ~/.zshrc con cui eseguirlo da questo account."
+ "value" : "Per inserirlo nel PATH serve un amministratore, e nelle Impostazioni di Peel trovi una riga per la tua shell con cui eseguirlo da questo account."
}
},
"ja" : {
"stringUnit" : {
"state" : "translated",
- "value" : "PATHの通った場所に置くには管理者が必要ですが、Peelの“設定”には、このアカウントから実行するための~/.zshrc用の行が用意されています。"
+ "value" : "PATHの通った場所に置くには管理者が必要ですが、Peelの“設定”には、このアカウントから実行するためのシェル用の行が用意されています。"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
- "value" : "PATH에 추가하려면 관리자가 필요하며, Peel 설정에는 이 계정에서 이 도구를 실행할 수 있게 하는 ~/.zshrc용 줄이 있습니다."
+ "value" : "PATH에 추가하려면 관리자가 필요하며, Peel 설정에는 이 계정에서 이 도구를 실행할 수 있게 하는 셸용 줄이 있습니다."
}
},
"nl" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Om het aan het zoekpad toe te voegen, is een beheerder nodig, en in Peel-instellingen staat een regel voor ~/.zshrc waarmee je het vanuit deze account kunt uitvoeren."
+ "value" : "Om het aan het zoekpad toe te voegen, is een beheerder nodig, en in Peel-instellingen staat een regel voor je shell waarmee je het vanuit deze account kunt uitvoeren."
}
},
"pl" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Dodanie go do zmiennej PATH wymaga administratora, a w Ustawieniach Peel znajdziesz wiersz do pliku ~/.zshrc, dzięki któremu uruchomisz go z tego konta."
+ "value" : "Dodanie go do zmiennej PATH wymaga administratora, a w Ustawieniach Peel znajdziesz wiersz dla swojej powłoki, dzięki któremu uruchomisz go z tego konta."
}
},
"pt" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Colocar a ferramenta no PATH requer um administrador, e os Ajustes do Peel oferecem uma linha para o ~/.zshrc que permite executá-la a partir desta conta."
+ "value" : "Colocar a ferramenta no PATH requer um administrador, e os Ajustes do Peel oferecem uma linha para o seu shell que permite executá-la a partir desta conta."
}
},
"ro" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Pentru a‑l adăuga în PATH este nevoie de un administrator, iar în configurările Peel găsiți o linie pentru ~/.zshrc, cu care îl puteți rula din acest cont."
+ "value" : "Pentru a‑l adăuga în PATH este nevoie de un administrator, iar în configurările Peel găsiți o linie pentru shellul dvs., cu care îl puteți rula din acest cont."
}
},
"ru" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Поместить инструмент в PATH может только администратор, а в Настройках Peel есть строка для ~/.zshrc, с которой его можно запускать из этой учетной записи."
+ "value" : "Поместить инструмент в PATH может только администратор, а в Настройках Peel есть строка для Вашей оболочки, с которой его можно запускать из этой учетной записи."
}
},
"sv" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Det krävs en administratör för att lägga till det i sökvägen, och i Peels inställningar finns en rad för ~/.zshrc som gör att det kan köras från det här kontot."
+ "value" : "Det krävs en administratör för att lägga till det i sökvägen, och i Peels inställningar finns en rad för din kommandotolk som gör att det kan köras från det här kontot."
}
},
"tr" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Onu komut arama yoluna eklemek için bir yönetici gerekir; Peel Ayarları ise onu bu hesaptan çalıştırmak için ~/.zshrc dosyasına eklenecek bir satır sunar."
+ "value" : "Onu komut arama yoluna eklemek için bir yönetici gerekir; Peel Ayarları ise kabuğunuz için onu bu hesaptan çalıştıran bir satır sunar."
}
},
"uk" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Додати інструмент до PATH може лише адміністратор, а в Параметрах Peel є рядок для ~/.zshrc, завдяки якому його можна запускати з цього облікового запису."
+ "value" : "Додати інструмент до PATH може лише адміністратор, а в Параметрах Peel є рядок для вашої оболонки, завдяки якому його можна запускати з цього облікового запису."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "将它放到PATH中需要管理员,不过Peel的“设置”会提供一行可添加到~/.zshrc的代码,让你能在此账户中运行它。"
+ "value" : "将它放到PATH中需要管理员,不过Peel的“设置”会为你的shell提供一行代码,让你能在此账户中运行它。"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
- "value" : "將它加入PATH需要管理者,而Peel「設定」提供了可加入~/.zshrc的一行設定,讓你從此帳號執行它。"
+ "value" : "將它加入PATH需要管理者,而Peel「設定」提供了適用於你的Shell的一行設定,讓你從此帳號執行它。"
}
}
}
@@ -150945,6 +151050,112 @@
}
}
},
+ "Remove From List" : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Odebrat ze seznamu"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Aus Liste entfernen"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Eliminar de la lista"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Retirer de la liste"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Rimuovi dall’elenco"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "リストから削除"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "목록에서 제거"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Verwijder uit lijst"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Usuń z listy"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Remover da Lista"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Eliminați din listă"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Удалить из списка"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Ta bort från listan"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Listeden Çıkar"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Вилучити зі списку"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "从列表中移除"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "從列表移除"
+ }
+ }
+ }
+ },
"Remove Peel" : {
"localizations" : {
"cs" : {
@@ -152536,6 +152747,112 @@
}
}
},
+ "Removing Peel leaves the peel command in place. To remove it too, an administrator runs this command in Terminal:" : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Po odstranění Peelu zůstane příkaz peel na místě. Chcete-li ho odstranit také, musí správce spustit v Terminálu tento příkaz:"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Wenn du Peel entfernst, bleibt der Befehl „peel“ erhalten. Um auch ihn zu entfernen, muss ein Administrator diesen Befehl im Terminal ausführen:"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Al eliminar Peel, el comando peel se queda donde está. Para eliminarlo también, un administrador debe ejecutar este comando en Terminal:"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Supprimer Peel laisse la commande peel en place. Pour la supprimer aussi, un administrateur doit exécuter cette commande dans Terminal :"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Se rimuovi Peel, il comando peel resta al suo posto. Per rimuovere anche quello, un amministratore deve eseguire questo comando in Terminale:"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peelをアンインストールしても、peelコマンドはそのまま残ります。コマンドも取り除くには、管理者がターミナルで以下のコマンドを実行する必要があります:"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel을 제거해도 peel 명령은 그대로 남습니다. 이 명령도 제거하려면 관리자가 터미널에서 다음 명령을 실행해야 합니다:"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Als je Peel verwijdert, blijft het commando peel staan. Om het ook te verwijderen, voert een beheerder dit commando uit in Terminal:"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Odinstalowanie Peel pozostawia polecenie peel na miejscu. Aby je także usunąć, administrator musi uruchomić to polecenie w Terminalu:"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Remover o Peel deixa o comando peel onde está. Para removê-lo também, um administrador precisa executar este comando no Terminal:"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Eliminarea aplicației Peel lasă comanda peel pe loc. Pentru a o elimina și pe ea, un administrator trebuie să ruleze această comandă în Terminal:"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "После удаления Peel команда peel остается на месте. Чтобы удалить и ее, администратор должен выполнить эту команду в Терминале:"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Om du tar bort Peel finns kommandot peel kvar. Om du vill ta bort det också måste en administratör köra det här kommandot i Terminal:"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Peel’i kaldırmak peel komutunu yerinde bırakır. Onu da kaldırmak için bir yöneticinin bu komutu Terminal’de çalıştırması gerekir:"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Після вилучення Peel команда peel лишається на місці. Щоб вилучити і її, адміністратор має виконати цю команду в Терміналі:"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "移除Peel不会移除peel命令。若要一并移除它,需要由管理员在“终端”中运行此命令:"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "移除Peel後,peel指令仍會保留。若也要移除它,需由管理者在「終端機」中執行此指令:"
+ }
+ }
+ }
+ },
"Removing Peel leaves the peel command in place. To remove it too, run this command in Terminal:" : {
"localizations" : {
"cs" : {
@@ -202888,6 +203205,112 @@
}
}
},
+ "Turned off in Login Items & Extensions" : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Vypnuto v části Aktivace položek a rozšíření při přihlášení"
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "In „Anmeldeobjekte & Erweiterungen“ deaktiviert"
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Desactivado en Ítems de inicio y extensiones"
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Désactivé dans Ouverture et extensions"
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Disattivato in “Elementi login ed estensioni”"
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "“ログイン項目と機能拡張”でオフにされています"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "로그인 항목 및 확장 프로그램에서 꺼짐"
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Uitgeschakeld in 'Inlogonderdelen en extensies'"
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Wyłączone w panelu Rzeczy i rozszerzenia otwierane podczas logowania"
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Desativado em Itens de Início de Sessão e Extensões"
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Dezactivat în Lansare la login și extensii"
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Выключено в разделе «Объекты входа и расширения»"
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Avstängt i Startobjekt och tillägg"
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Oturum Açma Öğeleri ve Genişletmeler’de kapatıldı"
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Вимкнено в розділі «Автозапуск і розширення»"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已在登录项与扩展中关闭"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "已在「登入項目與延伸功能」中關閉"
+ }
+ }
+ }
+ },
"Turned on" : {
"localizations" : {
"cs" : {
diff --git a/Packages/PeelCore/Sources/PeelCommandLine/Commands/ExclusionCommands.swift b/Packages/PeelCore/Sources/PeelCommandLine/Commands/ExclusionCommands.swift
index 2b821a67..3b8b9799 100644
--- a/Packages/PeelCore/Sources/PeelCommandLine/Commands/ExclusionCommands.swift
+++ b/Packages/PeelCore/Sources/PeelCommandLine/Commands/ExclusionCommands.swift
@@ -13,9 +13,9 @@ struct ExclusionsCommand: AsyncParsableCommand {
/// Returns the saved exclusions, or throws when the file exists but can't be read. Saving would set that
/// file aside and silently drop what the user chose. Only the app starts a new list, after warning the user.
- static func current(in store: ExclusionStore) async throws -> Exclusions {
+ static func current(in store: ExclusionStore, whenUnreadable said: String = unreadable) async throws -> Exclusions {
let exclusions = await store.load()
- guard !exclusions.isUnreadable else { throw CommandFailure(unreadable) }
+ guard !exclusions.isUnreadable else { throw CommandFailure(said) }
return exclusions
}
@@ -55,7 +55,10 @@ struct ExclusionsCommand: AsyncParsableCommand {
}
func run(in store: ExclusionStore) async throws {
- let exclusions = try await ExclusionsCommand.current(in: store)
+ let exclusions = try await ExclusionsCommand.current(
+ in: store,
+ whenUnreadable: "Peel couldn't read its exclusions file, so it can't say what it leaves alone. Open Peel and click Start Over in Settings > Exclusions."
+ )
let paths = exclusions.paths.map(Output.path).sorted()
let apps = exclusions.bundleIdentifiers.sorted()
diff --git a/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift b/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift
index 0a8ffc23..6d6f05f6 100644
--- a/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift
+++ b/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift
@@ -211,6 +211,10 @@ enum Output {
if !catalog.unreadable.isEmpty {
notes.append(unreadableNote(for: catalog.unreadable, needsFullDiskAccess: catalog.needsFullDiskAccess))
}
+ if !catalog.foldersLeftOut.isEmpty {
+ let folders = list(named(catalog.foldersLeftOut.map(\.folder)))
+ notes.append("Peel no longer looks in \(folders), so the apps there aren't listed. Choose the folder that holds the apps in Settings > General > App Folders.")
+ }
return notes.isEmpty ? nil : notes.joined(separator: "\n")
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Apps/AppCatalog.swift b/Packages/PeelCore/Sources/PeelCore/Apps/AppCatalog.swift
index dfb22f3c..1751fdf3 100644
--- a/Packages/PeelCore/Sources/PeelCore/Apps/AppCatalog.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Apps/AppCatalog.swift
@@ -12,12 +12,18 @@ public struct AppScan: Sendable, Equatable {
/// The folders the person chose that the reading looked in, beside the Applications folders, or nil when their
/// list is there and could not be read.
public let chosenFolders: [URL]?
+ /// The folders on that list it no longer reads, whose apps it doesn't list.
+ public let foldersLeftOut: [AppFolders.LeftOut]
- init(apps: [InstalledApp], unreadable: [URL], needsFullDiskAccess: Bool, chosenFolders: [URL]? = []) {
+ init(
+ apps: [InstalledApp], unreadable: [URL] = [], needsFullDiskAccess: Bool = false, chosenFolders: [URL]? = [],
+ foldersLeftOut: [AppFolders.LeftOut] = []
+ ) {
self.apps = apps
self.unreadable = unreadable
self.needsFullDiskAccess = needsFullDiskAccess
self.chosenFolders = chosenFolders
+ self.foldersLeftOut = foldersLeftOut
}
/// Whether the list of folders the person chose could not be read, so the apps in those folders are missing from
@@ -100,7 +106,8 @@ public enum AppCatalog {
apps: found.apps,
unreadable: found.unreadable,
needsFullDiskAccess: found.needsFullDiskAccess,
- chosenFolders: chosen
+ chosenFolders: chosen,
+ foldersLeftOut: choices.leftOut()
)
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Apps/AppFolders.swift b/Packages/PeelCore/Sources/PeelCore/Apps/AppFolders.swift
index cf26702b..9ee022f0 100644
--- a/Packages/PeelCore/Sources/PeelCore/Apps/AppFolders.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Apps/AppFolders.swift
@@ -4,7 +4,7 @@ internal import PeelPrivileged
/// The folders the person chose for Peel to look for apps in, beside the Applications folders: another disk, or a
/// folder of tools. Every reading of the installed apps looks in them, in the app and in `peel` alike.
public struct AppFolders: Sendable {
- public enum Refusal: Sendable, Equatable {
+ public enum Refusal: Sendable, Hashable {
/// A whole disk, the home folder, a Library or its Application Support, or one of macOS's own folders, which
/// would make every reading of the apps slow.
case tooBroad
@@ -16,6 +16,17 @@ public struct AppFolders: Sendable {
case inTheCloud
}
+ /// A folder on the saved list Peel no longer reads, since a rule came after it was chosen.
+ public struct LeftOut: Sendable, Hashable {
+ public let folder: URL
+ public let refusal: Refusal
+
+ public init(folder: URL, refusal: Refusal) {
+ self.folder = folder
+ self.refusal = refusal
+ }
+ }
+
public let url: URL
let home: URL
@@ -41,6 +52,19 @@ public struct AppFolders: Sendable {
FileLock.whileReading(beside: url) { url.isMissing ? [] : read() }
}
+ /// The folders the list holds that are no longer read, and why. One Peel reads anyway, as part of an Applications
+ /// folder, loses nothing.
+ public func leftOut() -> [LeftOut] {
+ guard !url.isMissing else { return [] }
+ return FileLock.whileReading(beside: url) {
+ (saved() ?? []).compactMap { path in
+ let folder = URL(filePath: path, directoryHint: .isDirectory)
+ let refusal = Self.refusal(of: folder, home: home)
+ return refusal.flatMap { $0 == .alreadyLookedIn ? nil : LeftOut(folder: folder, refusal: $0) }
+ }
+ }
+ }
+
/// Adds `folders`. False when they could not be saved, or when the file is there and cannot be read, since
/// writing over it would lose the folders it holds.
@discardableResult
@@ -110,18 +134,21 @@ public struct AppFolders: Sendable {
private func change(_ edit: (inout [String]) -> Void) -> Bool {
FileLock.whileHeld(beside: url) {
- guard var paths = read().map({ $0.map { $0.path(percentEncoded: false) } }) ?? (url.isMissing ? [] : nil)
- else { return false }
+ guard var paths = saved() ?? (url.isMissing ? [] : nil) else { return false }
edit(&paths)
guard let data = try? JSONEncoder().encode(paths) else { return false }
return (try? PeelFolder.write(data, to: url)) != nil
}
}
+ /// The paths as saved, or nil when the file cannot be read.
+ private func saved() -> [String]? {
+ BoundedRead.data(at: url).flatMap { try? JSONDecoder().decode([String].self, from: $0) }
+ }
+
/// The folders saved, less any refused now, which a list saved before the folder was refused can hold.
private func read() -> [URL]? {
- guard let data = BoundedRead.data(at: url), let paths = try? JSONDecoder().decode([String].self, from: data)
- else { return nil }
+ guard let paths = saved() else { return nil }
return paths.map { URL(filePath: $0, directoryHint: .isDirectory) }
.filter { Self.refusal(of: $0, home: home) == nil }
}
diff --git a/Packages/PeelCore/Sources/PeelCore/Home/Access.swift b/Packages/PeelCore/Sources/PeelCore/Home/Access.swift
index 7af7a9ec..91bd8334 100644
--- a/Packages/PeelCore/Sources/PeelCore/Home/Access.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Home/Access.swift
@@ -120,10 +120,21 @@ public enum CommandLineTool {
return link.map { "sudo mkdir -p /usr/local/bin && sudo \($0) '\(path)' \(CommandLineTool.path)" }
}
- /// What an account that is not an administrator adds to `~/.zshrc` to run `peel` from anywhere, since the link
- /// takes `sudo`. A function, since the shell reads an alias's text again and would split a path at a space.
- public static func zshrcLine(embedded: URL) -> String? {
- lastingPath(of: embedded).map { "peel() { '\($0)' \"$@\"; }" }
+ public struct ShellLine: Sendable, Equatable {
+ public let file: String
+ public let line: String
+ }
+
+ /// What an account that is not an administrator adds to its shell's startup file to run `peel` from anywhere, since
+ /// the link takes `sudo`. A function, since the shell reads an alias's text again and would split a path at a
+ /// space. Terminal starts a login shell, which is the one bash reads `~/.bash_profile` in.
+ public static func shellLine(embedded: URL, shell: String? = ShellSessions.loginShell()) -> ShellLine? {
+ guard let path = lastingPath(of: embedded) else { return nil }
+ return switch shell.map({ URL(filePath: $0).lastPathComponent }) {
+ case "fish": ShellLine(file: "~/.config/fish/config.fish", line: "function peel; '\(path)' $argv; end")
+ case "bash": ShellLine(file: "~/.bash_profile", line: "peel() { '\(path)' \"$@\"; }")
+ default: ShellLine(file: "~/.zshrc", line: "peel() { '\(path)' \"$@\"; }")
+ }
}
/// The tool's path with each single quote closed, escaped, and reopened, or nil from a temporary copy or a
diff --git a/Packages/PeelCore/Sources/PeelCore/Removal/SelfRemoval.swift b/Packages/PeelCore/Sources/PeelCore/Removal/SelfRemoval.swift
index 5937075a..a9704790 100644
--- a/Packages/PeelCore/Sources/PeelCore/Removal/SelfRemoval.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Removal/SelfRemoval.swift
@@ -93,6 +93,12 @@ public enum SelfRemoval {
return isOnAReadOnlyVolume ? .readOnlyCopy : .needsAnAdministrator
}
+ /// Why Peel at `app` won't move itself, known from where it is before any plan is made.
+ public static func blockAhead(of app: URL) -> Block? {
+ if isOnAReadOnlyVolume(app) { return .readOnlyCopy }
+ return FileAccess.requiresPrivilegesToRemove(app) ? .needsAnAdministrator : nil
+ }
+
/// Whether `url` is on a volume mounted read-only (`statfs(2)`, `MNT_RDONLY`), which Foundation's resource value
/// doesn't say of the startup disk.
public static func isOnAReadOnlyVolume(_ url: URL) -> Bool {
diff --git a/Packages/PeelCore/Sources/PeelCore/Terminal/ShellSessions.swift b/Packages/PeelCore/Sources/PeelCore/Terminal/ShellSessions.swift
index 4df16d50..612fd35e 100644
--- a/Packages/PeelCore/Sources/PeelCore/Terminal/ShellSessions.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Terminal/ShellSessions.swift
@@ -125,7 +125,7 @@ public enum ShellSessions: Sendable, Equatable {
"/etc/\(name)rc_Apple_Terminal"
}
- static func loginShell(of user: uid_t = getuid()) -> String? {
+ public static func loginShell(of user: uid_t = getuid()) -> String? {
var capacity = 1_024
while capacity <= 65_536 {
var entry = passwd()
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/AlertDefaultButtonTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/AlertDefaultButtonTests.swift
index 24a277ae..cd17dce7 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/AlertDefaultButtonTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/AlertDefaultButtonTests.swift
@@ -19,4 +19,14 @@ struct AlertDefaultButtonTests {
}
#expect(found.isEmpty, "Return would press the first other button, not OK: \(found)")
}
+
+ @Test func removingPeelOrItsHelperKeepsReturnOnCancel() throws {
+ let settings = LineLengthTests.repository.appending(path: "Peel/Views/Settings/SettingsView.swift")
+ let lines = try String(contentsOf: settings, encoding: .utf8).components(separatedBy: "\n")
+ for title in ["Remove Peel from this Mac?", "Uninstall Peel’s helper?"] {
+ let start = try #require(lines.firstIndex { $0.contains(title) })
+ let cancel = try #require(lines[start...].firstIndex { $0.contains(#"Button("Cancel", role: .cancel)"#) })
+ #expect(lines[cancel + 1].contains(".keyboardShortcut(.defaultAction)"), "\(title)")
+ }
+ }
}
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/AppFoldersTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/AppFoldersTests.swift
index 8bc36526..2bf90f5d 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/AppFoldersTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/AppFoldersTests.swift
@@ -104,6 +104,43 @@ struct AppFoldersTests {
#expect(AppFolders(url: list, home: directory.url).load()?.map(\.lastPathComponent) == ["Tools"])
}
+ @Test func namesWhatItLeavesOutAndKeepsItUntilItIsTakenOff() throws {
+ let directory = try TemporaryDirectory()
+ let tools = try directory.directory("Tools")
+ let other = try directory.directory("Other")
+ let saved = ["/Volumes/Backup", tools.path(percentEncoded: false)]
+ let list = try directory.file("app-folders.json", contents: JSONEncoder().encode(saved))
+ let folders = AppFolders(url: list, home: directory.url)
+
+ let backup = URL(filePath: "/Volumes/Backup", directoryHint: .isDirectory)
+ #expect(folders.leftOut() == [AppFolders.LeftOut(folder: backup, refusal: .tooBroad)])
+
+ #expect(folders.add([other]))
+ #expect(folders.leftOut().map(\.refusal) == [.tooBroad], "an edit lost it without a word")
+ #expect(folders.load()?.map(\.lastPathComponent) == ["Tools", "Other"])
+
+ #expect(folders.remove([URL(filePath: "/Volumes/Backup")]))
+ #expect(folders.leftOut().isEmpty)
+ }
+
+ @Test func aFolderPeelReadsAnywayIsNotLeftOut() throws {
+ let directory = try TemporaryDirectory()
+ let inside = directory.url.appending(path: "Applications/Tools", directoryHint: .isDirectory)
+ let list = try directory.file(
+ "app-folders.json", contents: JSONEncoder().encode([inside.path(percentEncoded: false)])
+ )
+
+ #expect(AppFolders(url: list, home: directory.url).leftOut().isEmpty)
+ }
+
+ @Test func aMissingListLeavesOutNothingAndMakesNothing() throws {
+ let directory = try TemporaryDirectory()
+ let folder = directory.url.appending(path: "Peel")
+
+ #expect(AppFolders(url: folder.appending(path: "app-folders.json"), home: directory.url).leftOut().isEmpty)
+ #expect(folder.isMissing)
+ }
+
@Test func aReadingOfAnotherHomeLeavesOutAFolderInThatHomesTrash() throws {
let directory = try TemporaryDirectory()
let saved = [try directory.directory(".Trash/Apps"), try directory.directory("Tools")]
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift
index e7a10b9e..2c2a6f91 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift
@@ -44,6 +44,10 @@ struct CommandLineTests {
Output.unreadableNote(for: AppScan(apps: [], unreadable: [studio], needsFullDiskAccess: false))
== "Peel couldn't look inside /Volumes/Studio/Apps, so something may be there that isn't listed."
)
+ let leftOut = AppScan(apps: [], foldersLeftOut: [
+ AppFolders.LeftOut(folder: URL(filePath: "/Volumes/Backup"), refusal: .tooBroad),
+ ])
+ #expect(Output.unreadableNote(for: leftOut)?.contains("no longer looks in /Volumes/Backup") == true)
let listUnread = AppScan(apps: [], unreadable: [], needsFullDiskAccess: false, chosenFolders: nil)
#expect(Output.unreadableNote(for: listUnread) == "Peel can't read its list of app folders, so the apps in them aren't listed. Start it over in Settings > General > App Folders.")
}
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/ExclusionCommandTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/ExclusionCommandTests.swift
index 9b141b09..4d5b2f23 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/ExclusionCommandTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/ExclusionCommandTests.swift
@@ -222,9 +222,11 @@ struct ExclusionCommandTests {
await #expect(throws: CommandFailure.self) {
try await remove(["/Users/me/thing"], in: store)
}
- await #expect(throws: CommandFailure.self) {
+ let failure = await #expect(throws: CommandFailure.self) {
try await list(in: store)
}
+ #expect(failure?.description.contains("won't change it") == false, "nobody asked for a change")
+ #expect(failure?.description.contains("Start Over") == true)
#expect(try Data(contentsOf: store.url) == Data("not json".utf8))
}
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/HomeTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/HomeTests.swift
index 93af629c..82ec6a25 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/HomeTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/HomeTests.swift
@@ -283,9 +283,15 @@ struct AppManagementTests {
let quoted = URL(filePath: "/Users/someone/Apps/It's Peel.app/Contents/Helpers/peel")
let translocated = URL(filePath: "/private/var/folders/x/AppTranslocation/41B9A/d/Peel.app/Contents/Helpers/peel")
- #expect(CommandLineTool.zshrcLine(embedded: embedded) == "peel() { '/Applications/Peel.app/Contents/Helpers/peel' \"$@\"; }")
- #expect(CommandLineTool.zshrcLine(embedded: quoted) == "peel() { '/Users/someone/Apps/It'\\''s Peel.app/Contents/Helpers/peel' \"$@\"; }")
- #expect(CommandLineTool.zshrcLine(embedded: translocated) == nil)
+ #expect(CommandLineTool.shellLine(embedded: embedded, shell: "/bin/zsh")?.line == "peel() { '/Applications/Peel.app/Contents/Helpers/peel' \"$@\"; }")
+ #expect(CommandLineTool.shellLine(embedded: quoted, shell: "/bin/zsh")?.line == "peel() { '/Users/someone/Apps/It'\\''s Peel.app/Contents/Helpers/peel' \"$@\"; }")
+ #expect(CommandLineTool.shellLine(embedded: translocated) == nil)
+ #expect(CommandLineTool.shellLine(embedded: embedded, shell: "/bin/zsh")?.file == "~/.zshrc")
+ #expect(CommandLineTool.shellLine(embedded: embedded, shell: nil)?.file == "~/.zshrc")
+ #expect(CommandLineTool.shellLine(embedded: embedded, shell: "/bin/bash")?.file == "~/.bash_profile")
+ let fish = CommandLineTool.shellLine(embedded: embedded, shell: "/opt/homebrew/bin/fish")
+ #expect(fish?.file == "~/.config/fish/config.fish")
+ #expect(fish?.line == "function peel; '/Applications/Peel.app/Contents/Helpers/peel' $argv; end")
}
/// Installed with Homebrew on a Mac with Apple silicon, the `peel` command is Homebrew's link in
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/SelfRemovalTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/SelfRemovalTests.swift
index 14c68527..68f91c3b 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/SelfRemovalTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/SelfRemovalTests.swift
@@ -364,6 +364,17 @@ struct SelfRemovalTests {
#expect(try String(contentsOf: moved.trashedURL.appending(path: "removals.json"), encoding: .utf8) == "2")
}
+ @Test(.permissionsHold) func knowsAheadThatAFolderOnlyAnAdministratorCanChangeHoldsPeel() throws {
+ let directory = try TemporaryDirectory()
+ let app = try directory.directory("Applications/Peel.app")
+ #expect(SelfRemoval.blockAhead(of: app) == nil)
+
+ try directory.setPermissions(0o555, of: "Applications")
+ defer { try? directory.setPermissions(0o755, of: "Applications") }
+
+ #expect(SelfRemoval.blockAhead(of: app) == .needsAnAdministrator)
+ }
+
@Test func aScanThatEndsAfterPeelLeftDoesNotBringItsFolderBack() async throws {
let directory = try TemporaryDirectory()
let app = try directory.directory("home/Applications/Peel.app")
diff --git a/Peel/Model/AppLibrary.swift b/Peel/Model/AppLibrary.swift
index 0de77b74..ff0dad6d 100644
--- a/Peel/Model/AppLibrary.swift
+++ b/Peel/Model/AppLibrary.swift
@@ -70,6 +70,8 @@ final class AppLibrary {
/// The folders the person chose for apps, beside the Applications folders, or nil when their list cannot be read.
/// `PeelApp` watches them and reads the apps again when they change.
private(set) var folders: [URL]?
+ /// The folders on the list that are no longer read, which Settings names.
+ private(set) var foldersLeftOut: [AppFolders.LeftOut] = []
/// Counts the changes the person makes to that list, so a reading that began before one never shows its older list.
@ObservationIgnored private var folderChanges = 0
private(set) var couldNotSaveFolders = false
@@ -286,6 +288,7 @@ final class AppLibrary {
if answer == .started { couldNotSaveFolders = false }
folderChanges += 1
folders = appFolders.load()
+ foldersLeftOut = appFolders.leftOut()
return answer
}
@@ -295,12 +298,15 @@ final class AppLibrary {
couldNotSaveFolders = !change(appFolders)
folderChanges += 1
folders = appFolders.load()
+ foldersLeftOut = appFolders.leftOut()
}
/// Shows the list of chosen folders the reading looked in, so Settings and the pages say the same of it, unless
/// the person changed the list since the reading began: that change brings a reading of its own.
private func showFolders(of scan: AppScan, readSince changes: Int) {
- if changes == folderChanges, scan.chosenFolders != folders { folders = scan.chosenFolders }
+ guard changes == folderChanges else { return }
+ if scan.chosenFolders != folders { folders = scan.chosenFolders }
+ if scan.foldersLeftOut != foldersLeftOut { foldersLeftOut = scan.foldersLeftOut }
}
/// Reads the folders again without emptying the list first, so an app installed while Peel is open
diff --git a/Peel/Model/HomeModel.swift b/Peel/Model/HomeModel.swift
index 67b5d312..de79636e 100644
--- a/Peel/Model/HomeModel.swift
+++ b/Peel/Model/HomeModel.swift
@@ -186,7 +186,7 @@ final class HomeModel {
break
}
if state == .notThisAccount {
- return "Putting it on the path takes an administrator, and Peel’s Settings gives a line for ~/.zshrc that runs it from this account."
+ return "Putting it on the path takes an administrator, and Peel’s Settings gives a line for your shell that runs it from this account."
}
if standing == .somethingElse {
return "Something else is at \(CommandLineTool.path), and Peel offers no command that would replace it."
diff --git a/Peel/Model/SelfUninstall.swift b/Peel/Model/SelfUninstall.swift
index caa5054f..189fbd3b 100644
--- a/Peel/Model/SelfUninstall.swift
+++ b/Peel/Model/SelfUninstall.swift
@@ -184,7 +184,7 @@ final class SelfUninstall {
case .readOnlyCopy:
String(localized: "Peel is running from a copy macOS made because it is still marked as downloaded, or from its disk image, and that copy can’t be moved. Quit Peel, move it to the Applications folder, open it there, and choose Remove Peel again.")
case .needsAnAdministrator:
- String(localized: "Peel won’t move itself from here: its folder needs an administrator. Drag it to the Trash in Finder, which asks for an administrator.")
+ String(localized: "Peel won’t move itself from here: its folder needs an administrator. Log in as an administrator and choose Remove Peel there, or drag it to the Trash in Finder, which asks for one.")
}
}
diff --git a/Peel/Views/Home/HomePermissionsView.swift b/Peel/Views/Home/HomePermissionsView.swift
index d4ad6e5e..f72fcbdc 100644
--- a/Peel/Views/Home/HomePermissionsView.swift
+++ b/Peel/Views/Home/HomePermissionsView.swift
@@ -368,6 +368,7 @@ extension HomeModel {
case (.helper, .pending): "Needs approval, or was turned off"
case (.finderExtension, .off) where isFinderExtensionFromAnotherCopy: "On in another copy of Peel"
case (.openAtLogin, .off) where loginItem.failure != nil: "Couldn’t turn on"
+ case (.openAtLogin, .off) where loginItem.needsApproval: "Turned off in Login Items & Extensions"
case (_, .notThisAccount): "Needs an administrator"
case (.appManagement, .pending):
appManagementAwaitsARemoval ? "Checked at the next removal" : "Checked at first removal"
diff --git a/Peel/Views/Settings/AppFoldersSection.swift b/Peel/Views/Settings/AppFoldersSection.swift
index 91bf5c3a..66de817a 100644
--- a/Peel/Views/Settings/AppFoldersSection.swift
+++ b/Peel/Views/Settings/AppFoldersSection.swift
@@ -6,22 +6,10 @@ struct AppFoldersSection: View {
@Environment(AppLibrary.self) private var library
@State private var isChoosing = false
@State private var selected: Set<URL> = []
- @State private var refusedAsTooBroad: [String] = []
- @State private var refusedAsLookedIn: [String] = []
- @State private var refusedInATrash: [String] = []
- @State private var refusedInTheCloud: [String] = []
+ @State private var refused: [AppFolders.LeftOut] = []
private var isShowingRefusal: Binding<Bool> {
- Binding(
- get: { !(refusedAsTooBroad + refusedAsLookedIn + refusedInATrash + refusedInTheCloud).isEmpty },
- set: {
- guard !$0 else { return }
- refusedAsTooBroad = []
- refusedAsLookedIn = []
- refusedInATrash = []
- refusedInTheCloud = []
- }
- )
+ Binding(get: { !refused.isEmpty }, set: { if !$0 { refused = [] } })
}
var body: some View {
@@ -54,6 +42,16 @@ struct AppFoldersSection: View {
}
}
}
+ if !library.foldersLeftOut.isEmpty {
+ VStack(alignment: .leading, spacing: 6) {
+ StatusLabel(title: Text("Peel no longer looks in these folders, so the apps in them aren’t listed."))
+ Self.message(for: library.foldersLeftOut)
+ .font(.caption)
+ .foregroundStyle(.secondary)
+ .textSelection(.enabled)
+ Button("Remove From List") { library.removeFolders(library.foldersLeftOut.map(\.folder)) }
+ }
+ }
if library.couldNotSaveFolders {
StatusLabel(title: Text("Peel couldn’t save the app folders."))
}
@@ -73,34 +71,34 @@ struct AppFoldersSection: View {
isPresented: $isChoosing, allowedContentTypes: [.folder], allowsMultipleSelection: true
) { result in
guard let urls = try? result.get() else { return }
- let refusals = urls.compactMap { url in AppFolders.refusal(of: url).map { (url: url, refusal: $0) } }
- refusedAsTooBroad = refusals.filter { $0.refusal == .tooBroad }.map(\.url.abbreviatedPath)
- refusedAsLookedIn = refusals.filter { $0.refusal == .alreadyLookedIn }.map(\.url.abbreviatedPath)
- refusedInATrash = refusals.filter { $0.refusal == .inATrash }.map(\.url.abbreviatedPath)
- refusedInTheCloud = refusals.filter { $0.refusal == .inTheCloud }.map(\.url.abbreviatedPath)
- let adding = urls.filter { url in !refusals.contains { $0.url == url } }
+ refused = urls.compactMap { url in AppFolders.refusal(of: url).map { .init(folder: url, refusal: $0) } }
+ let adding = urls.filter { url in !refused.contains { $0.folder == url } }
guard !adding.isEmpty else { return }
library.addFolders(adding)
}
.alert(
- (refusedAsTooBroad + refusedAsLookedIn + refusedInATrash + refusedInTheCloud).count == 1
- ? "That folder can’t be added." : "These folders can’t be added.",
+ refused.count == 1 ? "That folder can’t be added." : "These folders can’t be added.",
isPresented: isShowingRefusal
) {
Button("OK", role: .cancel) {}
} message: {
- refusalMessage
+ Self.message(for: refused)
}
}
- private var refusalMessage: Text {
- let tooBroad = Text("A folder as wide as a whole disk, your home folder, a Library, or one of macOS’s own would slow down every look for apps. Choose the folder that holds the apps.\n\n\(RemovalFailureAlert.firstItems(refusedAsTooBroad).joined(separator: "\n"))")
- let lookedIn = Text("Peel already looks in the Applications folders and in the folders inside them, three levels deep.\n\n\(RemovalFailureAlert.firstItems(refusedAsLookedIn).joined(separator: "\n"))")
- let inATrash = Text("The Trash holds what is on its way out, so Peel doesn’t look for apps there.\n\n\(RemovalFailureAlert.firstItems(refusedInATrash).joined(separator: "\n"))")
- let inTheCloud = Text("Reading a folder that iCloud or another cloud keeps can download what it holds, so Peel doesn’t look for apps there.\n\n\(RemovalFailureAlert.firstItems(refusedInTheCloud).joined(separator: "\n"))")
+ /// Why each of `folders` isn't taken, a paragraph for each reason, with the folders it holds for.
+ private static func message(for folders: [AppFolders.LeftOut]) -> Text {
+ func paths(_ refusal: AppFolders.Refusal) -> [String] {
+ folders.filter { $0.refusal == refusal }.map(\.folder.abbreviatedPath)
+ }
+ func named(_ refusal: AppFolders.Refusal) -> String {
+ RemovalFailureAlert.firstItems(paths(refusal)).joined(separator: "\n")
+ }
let parts = [
- (refusedAsTooBroad, tooBroad), (refusedAsLookedIn, lookedIn), (refusedInATrash, inATrash),
- (refusedInTheCloud, inTheCloud),
+ (paths(.tooBroad), Text("A folder as wide as a whole disk, your home folder, a Library, or one of macOS’s own would slow down every look for apps. Choose the folder that holds the apps.\n\n\(named(.tooBroad))")),
+ (paths(.alreadyLookedIn), Text("Peel already looks in the Applications folders and in the folders inside them, three levels deep.\n\n\(named(.alreadyLookedIn))")),
+ (paths(.inATrash), Text("The Trash holds what is on its way out, so Peel doesn’t look for apps there.\n\n\(named(.inATrash))")),
+ (paths(.inTheCloud), Text("Reading a folder that iCloud or another cloud keeps can download what it holds, so Peel doesn’t look for apps there.\n\n\(named(.inTheCloud))")),
]
.filter { !$0.0.isEmpty }.map(\.1)
return parts.dropFirst().reduce(parts.first ?? Text(verbatim: "")) { Text("\($0)\n\n\($1)") }
diff --git a/Peel/Views/Settings/SettingsView.swift b/Peel/Views/Settings/SettingsView.swift
index c6a6ade3..63179bb9 100644
--- a/Peel/Views/Settings/SettingsView.swift
+++ b/Peel/Views/Settings/SettingsView.swift
@@ -204,8 +204,8 @@ private struct GeneralSettingsView: View {
private var installCommand: String? { SettingsKey.commandLineInstallCommand(for: commandLine) }
private static let place = CommandLineTool.place()
private static let embeddedTool = Bundle.main.bundleURL.appending(path: "Contents/Helpers/peel")
- private var isStandardAccount: Bool { home.state(of: .commandLine) == .notThisAccount }
- private static let runsFromAReadOnlyCopy = SelfRemoval.isOnAReadOnlyVolume(Bundle.main.bundleURL)
+ private var isStandardAccount: Bool { !helper.isAvailableToThisAccount }
+ private static let blockAhead = SelfRemoval.blockAhead(of: Bundle.main.bundleURL)
@AppStorage(SettingsKey.checksForAppUpdates) private var checksForAppUpdates = true
@AppStorage(SettingsKey.updateSource) private var updateSource = UpdateSource.automatic.rawValue
@@ -397,10 +397,10 @@ private struct GeneralSettingsView: View {
}
if [.applications, .elsewhere].contains(Self.place), commandLine != .installed {
if isStandardAccount {
- if let line = CommandLineTool.zshrcLine(embedded: Self.embeddedTool) {
+ if let shell = CommandLineTool.shellLine(embedded: Self.embeddedTool) {
CopyableLines(
- caption: Text("Putting `peel` on the path takes an administrator. To use it from this account, add this line to ~/.zshrc, then open a new Terminal window."),
- lines: [line]
+ caption: Text("Putting `peel` on the path takes an administrator. To use it from this account, add this line to \(shell.file), then open a new Terminal window."),
+ lines: [shell.line]
)
}
} else if let installCommand {
@@ -451,7 +451,7 @@ private struct GeneralSettingsView: View {
// Peel's alone.
.disabled(
selfUninstall.isRunning || !library.hasLoaded || way.waitsForHomebrew
- || !history.mayMove || Self.runsFromAReadOnlyCopy || waitsForAnAdministrator
+ || !history.mayMove || Self.blockAhead != nil || waitsForAnAdministrator
)
}
if selfUninstall.isRunning {
@@ -474,8 +474,8 @@ private struct GeneralSettingsView: View {
Text("The disk is full, or Peel’s folder can’t be written. Peel removes nothing until it can, so that everything it moves can be put back.")
.font(.callout)
.foregroundStyle(.secondary)
- } else if Self.runsFromAReadOnlyCopy {
- Text(SelfUninstall.explanation(of: .readOnlyCopy))
+ } else if let block = Self.blockAhead {
+ Text(SelfUninstall.explanation(of: block))
.font(.callout)
.foregroundStyle(.secondary)
} else if waitsForAnAdministrator {
@@ -509,8 +509,14 @@ private struct GeneralSettingsView: View {
if selfUninstall.leavesCommandLineTool(helper: helper.status),
ownCask?.commandLinks.contains(CommandLineTool.path) != true {
VStack(alignment: .leading, spacing: 4) {
- Text("Removing Peel leaves the peel command in place. To remove it too, run this command in Terminal:")
- .font(.callout)
+ Group {
+ if isStandardAccount {
+ Text("Removing Peel leaves the peel command in place. To remove it too, an administrator runs this command in Terminal:")
+ } else {
+ Text("Removing Peel leaves the peel command in place. To remove it too, run this command in Terminal:")
+ }
+ }
+ .font(.callout)
Text(verbatim: SelfUninstall.removeCommand)
.font(.caption.monospaced())
}
@@ -544,6 +550,7 @@ private struct GeneralSettingsView: View {
}
}
Button("Cancel", role: .cancel) {}
+ .keyboardShortcut(.defaultAction)
} message: {
Text("Peel, the files that are certainly its own, and its folder in Application Support go to the Trash, all but the Terminal settings zsh and ssh read, and its settings are cleared. That folder holds History, your exclusions, App Folders, and Saved Settings, among others. What you set in Tweaks and on the Terminal page stays as it is. The space is freed when you empty the Trash.")
}
@@ -769,6 +776,7 @@ private struct HelperSettingsView: View {
Task { failure = await helper.uninstall() }
}
Button("Cancel", role: .cancel) {}
+ .keyboardShortcut(.defaultAction)
} message: {
Text("The helper serves every account on this Mac, so this removes it for all of them. Until it is installed again, Peel can’t move what only an administrator can change.")
}
diff --git a/PeelTests/HomeLoginItemTests.swift b/PeelTests/HomeLoginItemTests.swift
index b08f1d4c..6251b90e 100644
--- a/PeelTests/HomeLoginItemTests.swift
+++ b/PeelTests/HomeLoginItemTests.swift
@@ -50,6 +50,14 @@ struct HomeLoginItemTests {
#expect(home.action(for: .openAtLogin) == "Open System Settings")
}
+ @Test func saysWhenThePersonTurnedItOffInSystemSettings() async {
+ let item = LoginItem(read: { .requiresApproval }, change: { _ in LoginItem.Answer(status: .requiresApproval) })
+ let home = read(item)
+ await home.refresh()
+
+ #expect(home.status(of: .openAtLogin) == "Turned off in Login Items & Extensions")
+ }
+
@Test func saysWhenTurningItOnFailed() async {
let item = LoginItem(read: { .notRegistered }) { _ in
LoginItem.Answer(status: .notRegistered, error: "macOS said no")