mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-08-07 06:08:39 +02:00
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:
parent
c954bbb168
commit
67918e21d3
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue