Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.
Swift cache-cleanercleanerclideveloper-toolsdisk-cleanupdisk-spaceduplicate-finderhomebrewliquid-glassmac-cleanermacosmacos-appmacos-golden-gatemacos-tahoemacos-tweaksswiftswiftuiterminal-themesuninstalluninstaller
Say what to quit when a program keeps an item in place
Țugui Dragoș38345b620569
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstringsindex ca24decc..98bfca16 100644--- a/Localization/Peel/Localizable.xcstrings+++ b/Localization/Peel/Localizable.xcstrings@@ -38730,112 +38730,6 @@}}},- "Files in it are still open in %@, so Peel left it where it is." : {- "localizations" : {- "cs" : {- "stringUnit" : {- "state" : "translated",- "value" : "Soubory v ní jsou stále otevřené (%@), proto ji Peel nechal na místě."- }- },- "de" : {- "stringUnit" : {- "state" : "translated",- "value" : "Dateien darin sind noch in %@ geöffnet, daher hat Peel es an seinem Ort belassen."- }- },- "es" : {- "stringUnit" : {- "state" : "translated",- "value" : "Contiene archivos que siguen abiertos en %@, así que Peel lo ha dejado donde está."- }- },- "fr" : {- "stringUnit" : {- "state" : "translated",- "value" : "Des fichiers qu’il contient sont encore ouverts par %@ : Peel l’a donc laissé en place."- }- },- "it" : {- "stringUnit" : {- "state" : "translated",- "value" : "Contiene file ancora aperti in %@, quindi Peel l’ha lasciato dov’è."- }- },- "ja" : {- "stringUnit" : {- "state" : "translated",- "value" : "中のファイルが%@でまだ開かれているため、Peelはそのままにしました。"- }- },- "ko" : {- "stringUnit" : {- "state" : "translated",- "value" : "이 항목 안의 파일이 아직 %@에서 열려 있어서 Peel이 그대로 두었습니다."- }- },- "nl" : {- "stringUnit" : {- "state" : "translated",- "value" : "Bestanden erin zijn nog geopend in %@, dus Peel heeft het laten staan waar het is."- }- },- "pl" : {- "stringUnit" : {- "state" : "translated",- "value" : "Pliki wewnątrz są nadal otwarte przez: %@, więc Peel zostawił to na miejscu."- }- },- "pt" : {- "stringUnit" : {- "state" : "translated",- "value" : "Há arquivos dentro dele que ainda estão abertos em %@, por isso o Peel o deixou onde está."- }- },- "ro" : {- "stringUnit" : {- "state" : "translated",- "value" : "Unele fișiere din acest articol sunt încă deschise în %@, așa că Peel l‑a lăsat unde se află."- }- },- "ru" : {- "stringUnit" : {- "state" : "translated",- "value" : "Файлы в этом объекте все еще открыты в %@, поэтому Peel оставил его на месте."- }- },- "sv" : {- "stringUnit" : {- "state" : "translated",- "value" : "Filer i det är fortfarande öppna i %@, så Peel lät det ligga kvar där det är."- }- },- "tr" : {- "stringUnit" : {- "state" : "translated",- "value" : "İçindeki dosyalar hâlâ %@ tarafından açık tutuluyor, bu yüzden Peel onu yerinde bıraktı."- }- },- "uk" : {- "stringUnit" : {- "state" : "translated",- "value" : "Файли цього елемента досі відкриті в %@, тож Peel залишила його на місці."- }- },- "zh-Hans" : {- "stringUnit" : {- "state" : "translated",- "value" : "其中有文件仍在“%@”中打开,因此Peel将它留在了原处。"- }- },- "zh-Hant" : {- "stringUnit" : {- "state" : "translated",- "value" : "其中有檔案仍在「%@」中打開,因此Peel將它留在原處。"- }- }- }- },"Files named with an app’s identifier that no installed app claims will appear here." : {"localizations" : {"cs" : {@@ -58324,6 +58218,112 @@}}},+ "It is in use by %@. Quit %@, then try again." : {+ "localizations" : {+ "cs" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Používá ji %@. Ukončete %@ a zkuste to znovu."+ }+ },+ "de" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Es wird gerade von %@ verwendet. Beende %@ und versuche es dann erneut."+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Está en uso por %@. Sal de %@ antes de volver a intentarlo."+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Il est utilisé par %@. Quittez %@, puis réessayez."+ }+ },+ "it" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "È in uso da %@. Esci da %@, poi riprova."+ }+ },+ "ja" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@で使用中です。%@を終了してから、やり直してください。"+ }+ },+ "ko" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@에서 사용 중입니다. %@을(를) 종료한 다음 다시 시도하십시오."+ }+ },+ "nl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Het wordt gebruikt door %@. Stop %@ en probeer het opnieuw."+ }+ },+ "pl" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Jest używane przez: %@. Zakończ %@, a potem spróbuj ponownie."+ }+ },+ "pt" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Está em uso por %@. Encerre %@ e tente novamente."+ }+ },+ "ro" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Este utilizat de %@. Închideți %@, apoi încercați din nou."+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Объект используется: %@. Завершите %@, а затем повторите попытку."+ }+ },+ "sv" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Det används av %@. Avsluta %@ och försök sedan igen."+ }+ },+ "tr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "%@ tarafından kullanılıyor. Şu programlardan çıkıp yeniden deneyin: %@."+ }+ },+ "uk" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Його використовує %@. Завершіть %@ та спробуйте ще раз."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "它正在被“%@”使用。请退出“%@”,然后重试。"+ }+ },+ "zh-Hant" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "它正由%@使用中。請結束%@,然後再試一次。"+ }+ }+ }+ },"It is locked. In Finder, choose File > Get Info and deselect Locked, then try again." : {"localizations" : {"cs" : {diff --git a/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift b/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swiftindex be9030c0..57cfd02a 100644--- a/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift+++ b/Packages/PeelCore/Sources/PeelCommandLine/Support/Output.swift@@ -401,7 +401,7 @@ extension TrashFailure.Reason {case .somethingElseMoved(let name): "something else was at that path; it is in the Trash as \(Output.plain(name))"case .historyUnreadable: "History can't be read"case .heldOpen(let processes):- "files in it are still open in \(processes.map(Output.plain).joined(separator: ", "))"+ "in use by \(processes.map(Output.plain).joined(separator: ", ")); quit \(processes.count == 1 ? "it" : "them") and try again"case .failed(let message): Output.plain(message)}}diff --git a/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swiftindex ab2ae616..e5b24862 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/CommandLineTests.swift@@ -783,6 +783,12 @@ struct CommandLineTests {#expect(command.resetPrivacy)}+ /// A refusal for a program using the item says what to quit before trying again.+ @Test func aRefusalForAProgramUsingTheItemSaysWhatToQuit() {+ #expect(TrashFailure.Reason.heldOpen(by: ["FigmaAgent"]).summary == "in use by FigmaAgent; quit it and try again")+ #expect(TrashFailure.Reason.heldOpen(by: ["FigmaAgent", "java"]).summary == "in use by FigmaAgent, java; quit them and try again")+ }+/// The line printed about the privacy reset after the move, and whether it makes the command fail.@Test func saysWhatCameOfThePrivacyReset() {let editor = InstalledApp(url: URL(filePath: "/Applications/Editor.app", directoryHint: .isDirectory), bundleIdentifier: "com.example.editor", name: "Editor")diff --git a/Peel/Views/Presentation.swift b/Peel/Views/Presentation.swiftindex a54fccf8..6d350e6d 100644--- a/Peel/Views/Presentation.swift+++ b/Peel/Views/Presentation.swift@@ -149,7 +149,7 @@ extension TrashFailure.Reason {case .somethingElseMoved(let name): String(localized: "Something else was at that path by the time it moved. It is in the Trash as \(name), and Finder can put it back.")case .historyUnreadable: String(localized: "Peel couldn’t read History, and it moves nothing it can’t put back.")case .heldOpen(let processes):- String(localized: "Files in it are still open in \(processes.formatted(.list(type: .and))), so Peel left it where it is.")+ String(localized: "It is in use by \(processes.formatted(.list(type: .and))). Quit \(processes.formatted(.list(type: .and))), then try again.")case .failed(let message): FixedSentence.translated(message)}}