- Use `sort_by` to sort the array, rather than comparing each element
to the next.
- This doesn't error with complaints about clobbering at all when run on
`homebrew/cask`, hurray. And it also handles interpolations correctly,
rather than ignoring them.
Co-authored-by: Bevan Kay <email@bevankay.me>
- Interpolating the version into a path is a common pattern, but the interpolations
trip up the alphabetization autocorrect quite spectacularly, so let's
ignore them (for now?).
- Part of issue 16323.
- Previously this was being done manually by Cask maintainers.
- While we're here, enforce that the `zap trash` path is not in `[]` if
it only contains a single element.
- This is buggy on actual Casks, hence the draft PR.