File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,12 @@ Entries under the **Removed** section indicate items removed from the entire doc
1010
1111## Unreleased
1212
13+ ## 2025-09-18
14+
15+ ### Changed
16+
17+ - changed(alias func): _ brew_exec() doesn't output errors when 'brew doctor' is run
18+
1319## 2025-08-30
1420
1521### Removed
Original file line number Diff line number Diff line change @@ -63,19 +63,19 @@ zsh_completion="${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completio
6363# ###
6464# Helper to run a brew subcommand with a nice, consistent, colored log line.
6565#
66- # NOTE: This function is written in zsh, rather than bash. I'm not as familiar with zsh
67- # compared to bash, so this function was written with the help of ChatGPT .
66+ # NOTE: No error will be printed when running `brew doctor`, as it often returns non-zero
67+ # exit codes even when everything is fine .
6868_brew_exec () {
69- local subcmd=$1 ; shift
70- # Header
71- print -P -- " %F{blue}%B[INFO]%b%f %F{8}Executing:%f %F{8}$%f %B%F{white}brew%f%b %F{cyan}${subcmd} %f${*: + ${* } } "
72- # Run and report
73- if brew " $subcmd " " $@ " ; then
69+ local sub_cmd=$1 ; shift
70+ print -P -- " %F{blue}%B[INFO]%b%f %F{8}Executing:%f %F{8}$%f %B%F{white}brew%f%b %F{cyan}${sub_cmd} %f${*: + ${* } } "
71+ if brew " $sub_cmd " " $@ " ; then
7472 print -P -- " %F{green}[OK]%f"
7573 else
76- local ec=$?
77- print -P -- " %F{red}[ERROR]%f exit %B${ec} %b"
78- return $ec
74+ local error_code=$?
75+ if [[ $sub_cmd != " doctor" ]]; then
76+ print -P -- " %F{red}[ERROR]%f exit %B${error_code} %b"
77+ fi
78+ return $error_code
7979 fi
8080}
8181
You can’t perform that action at this time.
0 commit comments