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
15 changes: 14 additions & 1 deletion Library/Homebrew/cmd/bundle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ class Bundle < AbstractCommand
switch "--no-vscode",
description: "`dump` without VSCode (and forks/variants) extensions.",
env: :bundle_dump_no_vscode
switch "--no-go",
description: "`dump` without Go packages.",
env: :bundle_dump_no_go
switch "--describe",
description: "`dump` adds a description comment above each line, unless the " \
"dependency does not have a description.",
Expand All @@ -126,6 +129,8 @@ class Bundle < AbstractCommand

conflicts "--all", "--no-vscode"
conflicts "--vscode", "--no-vscode"
conflicts "--all", "--no-go"
conflicts "--go", "--no-go"
conflicts "--install", "--upgrade"
conflicts "--file", "--global"

Expand Down Expand Up @@ -206,6 +211,14 @@ def run
no_type_args
end

go = if args.no_go?
false
elsif args.go?
true
else
no_type_args
end

require "bundle/commands/dump"
Homebrew::Bundle::Commands::Dump.run(
global:, file:, force:,
Expand All @@ -216,7 +229,7 @@ def run
casks: args.casks? || no_type_args,
mas: args.mas? || no_type_args,
vscode:,
go: args.go? || no_type_args
go:
)
when "edit"
require "bundle/brewfile"
Expand Down
3 changes: 3 additions & 0 deletions Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/bundle.rbi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Library/Homebrew/test/bundle/dumper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
Homebrew::Bundle::CaskDumper.reset!
Homebrew::Bundle::MacAppStoreDumper.reset!
Homebrew::Bundle::VscodeExtensionDumper.reset!
Homebrew::Bundle::GoDumper.reset!
Homebrew::Bundle::BrewServices.reset!

chrome = instance_double(Cask::Cask,
Expand Down
1 change: 1 addition & 0 deletions completions/bash/brew
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ _brew_bundle() {
--help
--install
--mas
--no-go
--no-restart
--no-upgrade
--no-vscode
Expand Down
1 change: 1 addition & 0 deletions completions/fish/brew.fish
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ __fish_brew_complete_arg 'bundle' -l go -d '`list` or `dump` Go packages'
__fish_brew_complete_arg 'bundle' -l help -d 'Show this message'
__fish_brew_complete_arg 'bundle' -l install -d 'Run `install` before continuing to other operations, e.g. `exec`'
__fish_brew_complete_arg 'bundle' -l mas -d '`list` or `dump` Mac App Store dependencies'
__fish_brew_complete_arg 'bundle' -l no-go -d '`dump` without Go packages. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_GO` is set'
__fish_brew_complete_arg 'bundle' -l no-restart -d '`dump` does not add `restart_service` to formula lines'
__fish_brew_complete_arg 'bundle' -l no-upgrade -d '`install` does not run `brew upgrade` on outdated dependencies. `check` does not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set'
__fish_brew_complete_arg 'bundle' -l no-vscode -d '`dump` without VSCode (and forks/variants) extensions. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set'
Expand Down
5 changes: 3 additions & 2 deletions completions/zsh/_brew
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ _brew_bump_unversioned_casks() {
# brew bundle
_brew_bundle() {
_arguments \
'(--no-vscode)--all[`list` all dependencies]' \
'(--no-vscode --no-go)--all[`list` all dependencies]' \
'--cask[`list`, `dump` or `cleanup` Homebrew cask dependencies]' \
'--check[Check that all dependencies in the Brewfile are installed before running `exec`, `sh`, or `env`]' \
'--cleanup[`install` performs cleanup operation, same as running `cleanup --force`. Enabled by default if `$HOMEBREW_BUNDLE_INSTALL_CLEANUP` is set and `--global` is passed]' \
Expand All @@ -667,10 +667,11 @@ _brew_bundle() {
'--force[`install` runs with `--force`/`--overwrite`. `dump` overwrites an existing `Brewfile`. `cleanup` actually performs its cleanup operations]' \
'--formula[`list`, `dump` or `cleanup` Homebrew formula dependencies]' \
'(--file)--global[Read from or write to the `Brewfile` from `$HOMEBREW_BUNDLE_FILE_GLOBAL` (if set), `${XDG_CONFIG_HOME}/homebrew/Brewfile` (if `$XDG_CONFIG_HOME` is set), `~/.homebrew/Brewfile` or `~/.Brewfile` otherwise]' \
'--go[`list` or `dump` Go packages]' \
'(--no-go)--go[`list` or `dump` Go packages]' \
'--help[Show this message]' \
'(--upgrade)--install[Run `install` before continuing to other operations, e.g. `exec`]' \
'--mas[`list` or `dump` Mac App Store dependencies]' \
'(--all --go)--no-go[`dump` without Go packages. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_GO` is set]' \
'--no-restart[`dump` does not add `restart_service` to formula lines]' \
'--no-upgrade[`install` does not run `brew upgrade` on outdated dependencies. `check` does not check for outdated dependencies. Note they may still be upgraded by `brew install` if needed. Enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \
'(--all --vscode)--no-vscode[`dump` without VSCode (and forks/variants) extensions. Enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set]' \
Expand Down
5 changes: 5 additions & 0 deletions docs/Manpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ flags which will help with finding keg-only dependencies like `openssl`,
: `dump` without VSCode (and forks/variants) extensions. Enabled by default if
`$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set.

`--no-go`

: `dump` without Go packages. Enabled by default if
`$HOMEBREW_BUNDLE_DUMP_NO_GO` is set.

`--describe`

: `dump` adds a description comment above each line, unless the dependency does
Expand Down
3 changes: 3 additions & 0 deletions manpages/brew.1
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ Temporarily start services while running the \fBexec\fP or \fBsh\fP command\. En
\fB\-\-no\-vscode\fP
\fBdump\fP without VSCode (and forks/variants) extensions\. Enabled by default if \fB$HOMEBREW_BUNDLE_DUMP_NO_VSCODE\fP is set\.
.TP
\fB\-\-no\-go\fP
\fBdump\fP without Go packages\. Enabled by default if \fB$HOMEBREW_BUNDLE_DUMP_NO_GO\fP is set\.
.TP
\fB\-\-describe\fP
\fBdump\fP adds a description comment above each line, unless the dependency does not have a description\. Enabled by default if \fB$HOMEBREW_BUNDLE_DUMP_DESCRIBE\fP is set\.
.TP
Expand Down
Loading