Add HOMEBREW_BUNDLE_SERVICES variable to brew bundle

This allows another way to pass `--services` to `brew bundle`.
This commit is contained in:
Mike McQuaid 2025-04-23 17:20:14 +01:00
parent 141414a3c3
commit 60c047b5ea
No known key found for this signature in database
6 changed files with 18 additions and 5 deletions

View File

@ -87,7 +87,9 @@ module Homebrew
switch "--install",
description: "Run `install` before continuing to other operations e.g. `exec`."
switch "--services",
description: "Temporarily start services while running the `exec` or `sh` command."
env: :bundle_services,
description: "Temporarily start services while running the `exec` or `sh` command. " \
"This is enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set."
switch "-f", "--force",
description: "`install` runs with `--force`/`--overwrite`. " \
"`dump` overwrites an existing `Brewfile`. " \

View File

@ -508,6 +508,7 @@ _brew_bump() {
case "${cur}" in
-*)
__brewcomp "
--bump-synced
--cask
--debug
--eval-all

View File

@ -399,6 +399,7 @@ __fish_brew_complete_arg 'bottle' -a '(__fish_brew_suggest_formulae_installed)'
__fish_brew_complete_cmd 'bump' 'Displays out-of-date packages and the latest version available'
__fish_brew_complete_arg 'bump' -l bump-synced -d 'Bump additional formulae marked as synced with the given formulae'
__fish_brew_complete_arg 'bump' -l cask -d 'Check only casks'
__fish_brew_complete_arg 'bump' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'bump' -l eval-all -d 'Evaluate all formulae and casks'
@ -520,7 +521,7 @@ __fish_brew_complete_arg 'bundle' -l no-restart -d '`dump` does not add `restart
__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. This is 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. This is enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set'
__fish_brew_complete_arg 'bundle' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg 'bundle' -l services -d 'Temporarily start services while running the `exec` or `sh` command'
__fish_brew_complete_arg 'bundle' -l services -d 'Temporarily start services while running the `exec` or `sh` command. This is enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set'
__fish_brew_complete_arg 'bundle' -l tap -d '`list` or `dump` Homebrew tap dependencies'
__fish_brew_complete_arg 'bundle' -l upgrade -d '`install` runs `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set'
__fish_brew_complete_arg 'bundle' -l upgrade-formulae -d '`install` runs `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set'

View File

@ -534,6 +534,7 @@ _brew_bottle() {
# brew bump
_brew_bump() {
_arguments \
'--bump-synced[Bump additional formulae marked as synced with the given formulae]' \
'--debug[Display any debugging information]' \
'(--installed)--eval-all[Evaluate all formulae and casks]' \
'--full-name[Print formulae/casks with fully-qualified names]' \
@ -663,7 +664,7 @@ _brew_bundle() {
'--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. This is enabled by default if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \
'(--all --vscode)--no-vscode[`dump` without VSCode (and forks/variants) extensions. This is enabled by default if `$HOMEBREW_BUNDLE_DUMP_NO_VSCODE` is set]' \
'--quiet[Make some output more quiet]' \
'--services[Temporarily start services while running the `exec` or `sh` command]' \
'--services[Temporarily start services while running the `exec` or `sh` command. This is enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set]' \
'--tap[`list` or `dump` Homebrew tap dependencies]' \
'(--install)--upgrade[`install` runs `brew upgrade` on outdated dependencies, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \
'--upgrade-formulae[`install` runs `brew upgrade` on any of these comma-separated formulae, even if `$HOMEBREW_BUNDLE_NO_UPGRADE` is set]' \

View File

@ -258,7 +258,8 @@ flags which will help with finding keg-only dependencies like `openssl`,
`--services`
: Temporarily start services while running the `exec` or `sh` command.
: Temporarily start services while running the `exec` or `sh` command. This is
enabled by default if `$HOMEBREW_BUNDLE_SERVICES` is set.
`-f`, `--force`
@ -2136,6 +2137,10 @@ displays whether a pull request has been opened with the URL.
: Letter or word that the list of package results should alphabetically follow.
`--bump-synced`
: Bump additional formulae marked as synced with the given formulae.
### `bump-cask-pr` \[*`options`*\] *`cask`*
Create a pull request to update *`cask`* with a new version.

View File

@ -157,7 +157,7 @@ Read from or write to the \fBBrewfile\fP from \fB$HOMEBREW_BUNDLE_FILE_GLOBAL\fP
Run \fBinstall\fP before continuing to other operations e\.g\. \fBexec\fP\&\.
.TP
\fB\-\-services\fP
Temporarily start services while running the \fBexec\fP or \fBsh\fP command\.
Temporarily start services while running the \fBexec\fP or \fBsh\fP command\. This is enabled by default if \fB$HOMEBREW_BUNDLE_SERVICES\fP is set\.
.TP
\fB\-f\fP, \fB\-\-force\fP
\fBinstall\fP runs with \fB\-\-force\fP/\fB\-\-overwrite\fP\&\. \fBdump\fP overwrites an existing \fBBrewfile\fP\&\. \fBcleanup\fP actually performs its cleanup operations\.
@ -1342,6 +1342,9 @@ Open a pull request for the new version if none have been opened yet\.
.TP
\fB\-\-start\-with\fP
Letter or word that the list of package results should alphabetically follow\.
.TP
\fB\-\-bump\-synced\fP
Bump additional formulae marked as synced with the given formulae\.
.SS "\fBbump\-cask\-pr\fP \fR[\fIoptions\fP] \fIcask\fP"
Create a pull request to update \fIcask\fP with a new version\.
.P