dev-cmd/vendor-gems: add --no-commit switch

This commit is contained in:
Bo Anderson 2022-10-08 18:39:47 +01:00
parent 5e31f41a52
commit 6858e215dd
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65
6 changed files with 25 additions and 10 deletions

View File

@ -17,6 +17,8 @@ module Homebrew
comma_array "--update", comma_array "--update",
description: "Update all vendored Gems to the latest version." description: "Update all vendored Gems to the latest version."
switch "--no-commit",
description: "Do not generate a new commit upon completion."
named_args :none named_args :none
end end
@ -36,9 +38,11 @@ module Homebrew
ohai "bundle update" ohai "bundle update"
safe_system "bundle", "update", *args.update safe_system "bundle", "update", *args.update
unless args.no_commit?
ohai "git add Gemfile.lock" ohai "git add Gemfile.lock"
system "git", "add", "Gemfile.lock" system "git", "add", "Gemfile.lock"
end end
end
ohai "bundle install --standalone" ohai "bundle install --standalone"
safe_system "bundle", "install", "--standalone" safe_system "bundle", "install", "--standalone"
@ -46,6 +50,7 @@ module Homebrew
ohai "bundle pristine" ohai "bundle pristine"
safe_system "bundle", "pristine" safe_system "bundle", "pristine"
unless args.no_commit?
ohai "git add vendor/bundle" ohai "git add vendor/bundle"
system "git", "add", "vendor/bundle" system "git", "add", "vendor/bundle"
@ -56,4 +61,5 @@ module Homebrew
system "git", "commit", "--message", "brew vendor-gems: commit updates." system "git", "commit", "--message", "brew vendor-gems: commit updates."
end end
end end
end
end end

View File

@ -2462,6 +2462,7 @@ _brew_vendor_gems() {
__brewcomp " __brewcomp "
--debug --debug
--help --help
--no-commit
--quiet --quiet
--update --update
--verbose --verbose

View File

@ -1632,6 +1632,7 @@ __fish_brew_complete_arg 'uses; and not __fish_seen_argument -l cask -l casks' -
__fish_brew_complete_cmd 'vendor-gems' 'Install and commit Homebrew\'s vendored gems' __fish_brew_complete_cmd 'vendor-gems' 'Install and commit Homebrew\'s vendored gems'
__fish_brew_complete_arg 'vendor-gems' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'vendor-gems' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'vendor-gems' -l help -d 'Show this message' __fish_brew_complete_arg 'vendor-gems' -l help -d 'Show this message'
__fish_brew_complete_arg 'vendor-gems' -l no-commit -d 'Do not generate a new commit upon completion'
__fish_brew_complete_arg 'vendor-gems' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'vendor-gems' -l quiet -d 'Make some output more quiet'
__fish_brew_complete_arg 'vendor-gems' -l update -d 'Update all vendored Gems to the latest version' __fish_brew_complete_arg 'vendor-gems' -l update -d 'Update all vendored Gems to the latest version'
__fish_brew_complete_arg 'vendor-gems' -l verbose -d 'Make some output more verbose' __fish_brew_complete_arg 'vendor-gems' -l verbose -d 'Make some output more verbose'

View File

@ -1990,6 +1990,7 @@ _brew_vendor_gems() {
_arguments \ _arguments \
'--debug[Display any debugging information]' \ '--debug[Display any debugging information]' \
'--help[Show this message]' \ '--help[Show this message]' \
'--no-commit[Do not generate a new commit upon completion]' \
'--quiet[Make some output more quiet]' \ '--quiet[Make some output more quiet]' \
'--update[Update all vendored Gems to the latest version]' \ '--update[Update all vendored Gems to the latest version]' \
'--verbose[Make some output more verbose]' '--verbose[Make some output more verbose]'

View File

@ -1596,12 +1596,14 @@ If no options are passed, use `origin/master` as the start commit.
* `--before`: * `--before`:
Use the commit at the specified *`date`* as the start commit. Use the commit at the specified *`date`* as the start commit.
### `vendor-gems` [*`--update`*`=`] ### `vendor-gems` [*`--update`*`=`] [*`--no-commit`*]
Install and commit Homebrew's vendored gems. Install and commit Homebrew's vendored gems.
* `--update`: * `--update`:
Update all vendored Gems to the latest version. Update all vendored Gems to the latest version.
* `--no-commit`:
Do not generate a new commit upon completion.
## GLOBAL CASK OPTIONS ## GLOBAL CASK OPTIONS

View File

@ -2288,13 +2288,17 @@ Use the specified \fIcommit\fR as the start commit\.
\fB\-\-before\fR \fB\-\-before\fR
Use the commit at the specified \fIdate\fR as the start commit\. Use the commit at the specified \fIdate\fR as the start commit\.
. .
.SS "\fBvendor\-gems\fR [\fI\-\-update\fR\fB=\fR]" .SS "\fBvendor\-gems\fR [\fI\-\-update\fR\fB=\fR] [\fI\-\-no\-commit\fR]"
Install and commit Homebrew\'s vendored gems\. Install and commit Homebrew\'s vendored gems\.
. .
.TP .TP
\fB\-\-update\fR \fB\-\-update\fR
Update all vendored Gems to the latest version\. Update all vendored Gems to the latest version\.
. .
.TP
\fB\-\-no\-commit\fR
Do not generate a new commit upon completion\.
.
.SH "GLOBAL CASK OPTIONS" .SH "GLOBAL CASK OPTIONS"
These options are applicable to the \fBinstall\fR, \fBreinstall\fR, and \fBupgrade\fR subcommands with the \fB\-\-cask\fR flag\. These options are applicable to the \fBinstall\fR, \fBreinstall\fR, and \fBupgrade\fR subcommands with the \fB\-\-cask\fR flag\.
. .