Skip to content
This repository was archived by the owner on Mar 20, 2025. It is now read-only.

Commit 9eade55

Browse files
committed
bundle: add --upgrade switch.
This allows overriding the `HOMEBREW_BUNDLE_NO_UPGRADE` environment variable. The environment variable wasn't really documented specifically before so let's do that here, too.
1 parent f5acb38 commit 9eade55

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmd/bundle.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ class BundleCmd < AbstractCommand
6666
env: :bundle_no_upgrade,
6767
description: "`install` does not run `brew upgrade` on outdated dependencies. " \
6868
"`check` does not check for outdated dependencies. " \
69-
"Note they may still be upgraded by `brew install` if needed."
69+
"Note they may still be upgraded by `brew install` if needed." \
70+
"This is enabled by default if `HOMEBREW_BUNDLE_NO_UPGRADE` is set."
71+
switch "--upgrade",
72+
description: "`install` runs `brew upgrade` on outdated dependencies, " \
73+
"even if `HOMEBREW_BUNDLE_NO_UPGRADE` is set. "
7074
switch "-f", "--force",
7175
description: "`install` runs with `--force`/`--overwrite`. " \
7276
"`dump` overwrites an existing `Brewfile`. " \
@@ -126,7 +130,7 @@ def run
126130
global = args.global?
127131
file = args.file
128132
args.zap?
129-
no_upgrade = args.no_upgrade?
133+
no_upgrade = args.upgrade? ? false : args.no_upgrade?
130134
verbose = args.verbose?
131135
force = args.force?
132136
zap = args.zap?

0 commit comments

Comments
 (0)