aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-07-05 17:44:14 -0500
committerJack Nagel2014-07-05 17:44:32 -0500
commita75bb417d0a763c3b4fff7bef86846216a3d328d (patch)
tree84b77059ebcba74d5a2202e5ef3117b29d54c7da /Library
parentfcedd2e58964e95b6639faa541bff1a13a9cb918 (diff)
downloadhomebrew-a75bb417d0a763c3b4fff7bef86846216a3d328d.tar.bz2
brew-pull: avoid the "var = ... rescue nil" dance
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/cmd/brew-pull.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/Library/Contributions/cmd/brew-pull.rb b/Library/Contributions/cmd/brew-pull.rb
index 45e1f8e50..c7d9d02cf 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