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

Commit 4836e27

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 4836e27

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-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?

cmd/bundle.rbi

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ class Homebrew::Cmd::BundleCmd::Args < Homebrew::CLI::Args
5757
sig { returns(T::Boolean) }
5858
def taps?; end
5959

60+
sig { returns(T::Boolean) }
61+
def upgrade?; end
62+
6063
sig { returns(T::Boolean) }
6164
def verbose?; end
6265

0 commit comments

Comments
 (0)