Merge pull request #4247 from MikeMcQuaid/bump-formula-pr-bad-args

bump-formula-pr: improve bad argument handling.
This commit is contained in:
Mike McQuaid 2018-05-31 20:18:06 +01:00 committed by GitHub
commit 43bb5d28d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -339,6 +339,9 @@ module Homebrew
unless Homebrew.args.quiet?
ohai "replace #{old.inspect} with #{new.inspect}"
end
unless old
raise "No old value for new value #{new}! Did you pass the wrong arguments?"
end
contents.gsub!(old, new)
end
unless contents.errors.empty?
@ -352,6 +355,9 @@ module Homebrew
unless Homebrew.args.quiet?
ohai "replace #{old.inspect} with #{new.inspect}"
end
unless old
raise "No old value for new value #{new}! Did you pass the wrong arguments?"
end
s.gsub!(old, new)
end
end