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",
description: "Update all vendored Gems to the latest version."
switch "--no-commit",
description: "Do not generate a new commit upon completion."
named_args :none
end
@ -36,8 +38,10 @@ module Homebrew
ohai "bundle update"
safe_system "bundle", "update", *args.update
ohai "git add Gemfile.lock"
system "git", "add", "Gemfile.lock"
unless args.no_commit?
ohai "git add Gemfile.lock"
system "git", "add", "Gemfile.lock"
end
end
ohai "bundle install --standalone"
@ -46,14 +50,16 @@ module Homebrew
ohai "bundle pristine"
safe_system "bundle", "pristine"
ohai "git add vendor/bundle"
system "git", "add", "vendor/bundle"
unless args.no_commit?
ohai "git add vendor/bundle"
system "git", "add", "vendor/bundle"
Utils::Git.set_name_email!
Utils::Git.setup_gpg!
Utils::Git.set_name_email!
Utils::Git.setup_gpg!
ohai "git commit"
system "git", "commit", "--message", "brew vendor-gems: commit updates."
ohai "git commit"
system "git", "commit", "--message", "brew vendor-gems: commit updates."
end
end
end
end

View File

@ -2462,6 +2462,7 @@ _brew_vendor_gems() {
__brewcomp "
--debug
--help
--no-commit
--quiet
--update
--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_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 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 update -d 'Update all vendored Gems to the latest version'
__fish_brew_complete_arg 'vendor-gems' -l verbose -d 'Make some output more verbose'

View File

@ -1990,6 +1990,7 @@ _brew_vendor_gems() {
_arguments \
'--debug[Display any debugging information]' \
'--help[Show this message]' \
'--no-commit[Do not generate a new commit upon completion]' \
'--quiet[Make some output more quiet]' \
'--update[Update all vendored Gems to the latest version]' \
'--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`:
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.
* `--update`:
Update all vendored Gems to the latest version.
* `--no-commit`:
Do not generate a new commit upon completion.
## GLOBAL CASK OPTIONS

View File

@ -2288,13 +2288,17 @@ Use the specified \fIcommit\fR as the start commit\.
\fB\-\-before\fR
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\.
.
.TP
\fB\-\-update\fR
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"
These options are applicable to the \fBinstall\fR, \fBreinstall\fR, and \fBupgrade\fR subcommands with the \fB\-\-cask\fR flag\.
.