fix(macports): correct inverted port existence guard in port-livecheck-maintainer

The guard `(( ${+commands[port]} == 0 )) || { ...not found...; return 1 }`
was inverted. `${+commands[port]}` is 1 when `port` exists and 0 when it
doesn't, so:

- when `port` IS installed, `(( 1 == 0 ))` is false and the `||` block
  runs, printing "port: not found" and aborting;
- when `port` is NOT installed, `(( 0 == 0 ))` is true and the function
  proceeds, then fails trying to run a missing command.

Drop the `== 0` so the existence check reads correctly: run the
not-found branch only when `port` is actually absent.
This commit is contained in:
Your Name 2026-06-12 16:12:50 +01:00
commit 67918e21d3

View file

@ -8,7 +8,7 @@ alias puo="sudo port upgrade outdated"
alias pup="sudo port selfupdate && sudo port upgrade outdated" alias pup="sudo port selfupdate && sudo port upgrade outdated"
port-livecheck-maintainer() { port-livecheck-maintainer() {
(( ${+commands[port]} == 0 )) || { (( ${+commands[port]} )) || {
print -- "port: not found" >&2 print -- "port: not found" >&2
return 1 return 1
} }