From 67918e21d3e35734873af70ee1f2327d99f5411a Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 12 Jun 2026 16:12:50 +0100 Subject: [PATCH] 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. --- plugins/macports/macports.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/macports/macports.plugin.zsh b/plugins/macports/macports.plugin.zsh index d438057f9..9b2abf466 100644 --- a/plugins/macports/macports.plugin.zsh +++ b/plugins/macports/macports.plugin.zsh @@ -8,7 +8,7 @@ alias puo="sudo port upgrade outdated" alias pup="sudo port selfupdate && sudo port upgrade outdated" port-livecheck-maintainer() { - (( ${+commands[port]} == 0 )) || { + (( ${+commands[port]} )) || { print -- "port: not found" >&2 return 1 }