Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ Entries under the **Removed** section indicate items removed from the entire doc

## Unreleased

## 2025-09-18

### Changed

- changed(alias func): _brew_exec() doesn't output errors when 'brew doctor' is run

## 2025-08-30

### Removed
Expand Down
20 changes: 10 additions & 10 deletions includes/zshrc-files/zshrc-macos.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ zsh_completion="${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completio
####
# Helper to run a brew subcommand with a nice, consistent, colored log line.
#
# NOTE: This function is written in zsh, rather than bash. I'm not as familiar with zsh
# compared to bash, so this function was written with the help of ChatGPT.
# NOTE: No error will be printed when running `brew doctor`, as it often returns non-zero
# exit codes even when everything is fine.
_brew_exec() {
local subcmd=$1; shift
# Header
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${*:+ ${*}}"
# Run and report
if brew "$subcmd" "$@"; then
local sub_cmd=$1; shift
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${*:+ ${*}}"
if brew "$sub_cmd" "$@"; then
print -P -- "%F{green}[OK]%f"
else
local ec=$?
print -P -- "%F{red}[ERROR]%f exit %B${ec}%b"
return $ec
local error_code=$?
if [[ $sub_cmd != "doctor" ]]; then
print -P -- "%F{red}[ERROR]%f exit %B${error_code}%b"
fi
return $error_code
fi
}

Expand Down
2 changes: 1 addition & 1 deletion submodules/dotfiles