bump-revision: add --write switch

This commit is contained in:
Thierry Moisan 2021-09-05 13:41:15 -04:00
parent f0dbd8d9a5
commit 4f4448c514
No known key found for this signature in database
GPG Key ID: 2F797AD837292E8C

View File

@ -18,9 +18,13 @@ module Homebrew
EOS
switch "-n", "--dry-run",
description: "Print what would be done rather than doing it."
switch "--write-only",
description: "Make the expected file modifications without taking any Git actions."
flag "--message=",
description: "Append <message> to the default commit message."
conflicts "--dry-run", "--write-only"
named_args :formula, min: 1
end
end
@ -62,7 +66,7 @@ module Homebrew
message = "#{formula.name}: revision bump #{args.message}"
if args.dry_run?
ohai "git commit --no-edit --verbose --message=#{message} -- #{formula.path}"
else
elsif !args.write_only?
formula.path.parent.cd do
safe_system "git", "commit", "--no-edit", "--verbose",
"--message=#{message}", "--", formula.path