aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/formula.rb')
-rw-r--r--Library/Homebrew/formula.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index d553846e3..3563badec 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -355,6 +355,11 @@ class Formula
end
install_type = :from_url
+ elsif name.match bottle_regex
+ bottle_filename = Pathname(name).realpath
+ name = name.split('-').first
+ path = Formula.path(name)
+ install_type = :from_local_bottle
else
name = Formula.canonical_name(name)
@@ -395,6 +400,12 @@ class Formula
raise LoadError
end
+ if install_type == :from_local_bottle
+ formula = klass.new(name)
+ formula.downloader.local_bottle_path = bottle_filename
+ return formula
+ end
+
raise NameError if !klass.ancestors.include? Formula
return klass.new(name) if install_type == :from_name