From 4ab696e4f272d36b630b6aef33c8d1b9a7f82ef0 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 5 Jul 2014 17:44:14 -0500 Subject: [PATCH] brew-pull: avoid the "var = ... rescue nil" dance --- Library/Contributions/cmd/brew-pull.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Library/Contributions/cmd/brew-pull.rb b/Library/Contributions/cmd/brew-pull.rb index 45e1f8e505..c7d9d02cfa 100755 --- a/Library/Contributions/cmd/brew-pull.rb +++ b/Library/Contributions/cmd/brew-pull.rb @@ -80,7 +80,6 @@ ARGV.named.each do |arg| changed_formulae = [] - if tap_dir formula_dir = %w[Formula HomebrewFormula].find { |d| tap_dir.join(d).directory? } || "" else @@ -95,9 +94,12 @@ ARGV.named.each do |arg| # Don't try and do anything to removed files. if status == "A" || status == "M" name = File.basename(filename, ".rb") - formula = Formula[name] rescue nil - next unless formula - changed_formulae << formula + + begin + changed_formulae << Formula[name] + rescue FormulaUnavailableError + next + end end end