Mirror --write-only behaviour to cask, fix incorrect arg reference

This commit is contained in:
Bevan Kay 2021-10-20 22:36:07 +11:00
parent 73d0a5f681
commit 55d9e88a14
No known key found for this signature in database
GPG Key ID: 479C98436A4773B9
2 changed files with 5 additions and 2 deletions

View File

@ -22,8 +22,9 @@ 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", switch "--write-only",
description: "Make the expected file modifications without taking any Git actions." description: "Make the expected file modifications without taking any Git actions."
switch "--write", hidden: true
switch "--commit", switch "--commit",
depends_on: "--write", depends_on: "--write",
description: "When passed with `--write`, generate a new commit after writing changes "\ description: "When passed with `--write`, generate a new commit after writing changes "\
@ -61,6 +62,8 @@ module Homebrew
def bump_cask_pr def bump_cask_pr
args = bump_cask_pr_args.parse args = bump_cask_pr_args.parse
odeprecated "`brew bump-cask-pr --write`", "`brew bump-cask-pr --write-only`" if args.write?
# This will be run by `brew style` later so run it first to not start # This will be run by `brew style` later so run it first to not start
# spamming during normal output. # spamming during normal output.
Homebrew.install_bundler_gems! Homebrew.install_bundler_gems!

View File

@ -488,7 +488,7 @@ module GitHub
changed_files = [sourcefile_path] changed_files = [sourcefile_path]
changed_files += additional_files if additional_files.present? changed_files += additional_files if additional_files.present?
if args.dry_run? || (args.write? && !args.commit?) if args.dry_run? || (args.write_only? && !args.commit?)
remote_url = if args.no_fork? remote_url = if args.no_fork?
Utils.popen_read("git", "remote", "get-url", "--push", "origin").chomp Utils.popen_read("git", "remote", "get-url", "--push", "origin").chomp
else else