diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index aaaa158ab3..0867948815 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -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