Merge pull request #11977 from Moisan/bump_revision_write
bump-revision: add --write switch
This commit is contained in:
commit
bf7b043392
@ -290,6 +290,9 @@ module Homebrew
|
|||||||
|
|
||||||
sig { returns(T.nilable(T::Array[String])) }
|
sig { returns(T.nilable(T::Array[String])) }
|
||||||
def groups; end
|
def groups; end
|
||||||
|
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
|
def write_only?; end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -18,9 +18,13 @@ module Homebrew
|
|||||||
EOS
|
EOS
|
||||||
switch "-n", "--dry-run",
|
switch "-n", "--dry-run",
|
||||||
description: "Print what would be done rather than doing it."
|
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=",
|
flag "--message=",
|
||||||
description: "Append <message> to the default commit message."
|
description: "Append <message> to the default commit message."
|
||||||
|
|
||||||
|
conflicts "--dry-run", "--write-only"
|
||||||
|
|
||||||
named_args :formula, min: 1
|
named_args :formula, min: 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -62,7 +66,7 @@ module Homebrew
|
|||||||
message = "#{formula.name}: revision bump #{args.message}"
|
message = "#{formula.name}: revision bump #{args.message}"
|
||||||
if args.dry_run?
|
if args.dry_run?
|
||||||
ohai "git commit --no-edit --verbose --message=#{message} -- #{formula.path}"
|
ohai "git commit --no-edit --verbose --message=#{message} -- #{formula.path}"
|
||||||
else
|
elsif !args.write_only?
|
||||||
formula.path.parent.cd do
|
formula.path.parent.cd do
|
||||||
safe_system "git", "commit", "--no-edit", "--verbose",
|
safe_system "git", "commit", "--no-edit", "--verbose",
|
||||||
"--message=#{message}", "--", formula.path
|
"--message=#{message}", "--", formula.path
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user