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 items the removal alert leaves out, not its lines

Țugui Dragoșa174babea690
diff --git a/Peel/Views/RemovalFailureAlert.swift b/Peel/Views/RemovalFailureAlert.swift
index aceb4451..3cbb202e 100644
--- a/Peel/Views/RemovalFailureAlert.swift
+++ b/Peel/Views/RemovalFailureAlert.swift
@@ -47,8 +47,9 @@ struct RemovalFailureAlert: ViewModifier {
}
private var message: String {
- var lines = quitLines + outcome.failures.prefix(Self.mostListed).map { "\($0.url.abbreviatedPath)\n\($0.reason.explanation)" }
- let rest = outcome.failures.count - lines.count
+ let listed = outcome.failures.prefix(Self.mostListed)
+ var lines = quitLines + listed.map { "\($0.url.abbreviatedPath)\n\($0.reason.explanation)" }
+ let rest = outcome.failures.count - listed.count
if rest > 0 {
lines.append(String(inflecting: "And ^[\(rest) more item](inflect: true)."))
}