brew/Library/Homebrew/cmd/update-if-needed.sh
Mike McQuaid 5ec5063dc7
Add brew update-if-needed
This uses the logic in `brew.sh` for deciding whether or not to run
`brew update --auto-update` and makes it a dedicated command that can
be used instead of `brew update` in scripts to be really fast in the
no-op case.

`brew update` will always do at least some updating which is a nicer
default but is much slower.
2025-03-27 13:16:00 +00:00

7 lines
162 B
Bash

# Documentation defined in Library/Homebrew/cmd/update-if-needed.rb
homebrew-update-if-needed() {
export HOMEBREW_AUTO_UPDATE_COMMAND="1"
auto-update "$@"
}