- if HOMEBREW_TEMP is not writable, use the default temp directory
- when running `brew bundle exec`, strip various temporary directories
from the environment if they are not writable
- Rather than maintaining a list of Homebrew environment variables to
delete, delete all Homebrew (and Portable Ruby) internal variables
that won't be used by other tools.
- When exporting variables, only export variables that have changed.
- When exporting PATH-like variables, ensure the PATH is appending to
the existing path rather than replacing it and ensure we only include
newly added paths.
This flag allows you to specify formulae to upgrade, even if
`$HOMEBREW_BUNDLE_NO_UPGRADE` is set.
This is useful for upgrading specific formulae without upgrading all
formulae.
While we're here, let's add Sorbet signatures to the `Bundle` module
because I needed to add a new method there anyway.
Extract the relevant logic from `formula.rb`, moving to `keg.rb` and
then use this logic in `bundle/commands/cleanup.rb` to ensure that we
don't say we need to uninstall formulae that should be still kept.
If callers of `brew bundle check` have already output some formulae
errors, they can set the
`HOMEBREW_BUNDLE_CHECK_ALREADY_OUTPUT_FORMULAE_ERRORS` environment
variable to the names of the formulae that have already been output.
- Sort output by key so it's more readable.
- Skip exporting empty values because shell scripts treat them as unset.
- Skip exporting non-Homebrew things that were already set in the old
environment to avoid massive duplication and higher chances of e.g.
bad escapes breaking things.
We've had requests for this in Homebrew/bundle a few times so let's
implement it both for there and for `brew edit`.
Tested on my machine with `cursor` and working as expected.
This was in the (soon to be archived) Homebrew/homebrew-bundle
repository's `README`. There's some good content here that doesn't
cleanly fit into the `brew` manpage so let's move it here.
While we're here, let's de-emphasize `whalebrew` as it's not
widely used and add commented-out deprecation warnings for its future
deprecation.