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.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index cfdc0266a..134b4045f 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -274,6 +274,12 @@ class Formula
(dir = installed_prefix).directory? && dir.children.length > 0
end
+ # If at least one version of {Formula} is installed.
+ def any_version_installed?
+ require "tab"
+ rack.directory? && rack.subdirs.any? { |keg| (keg/Tab::FILENAME).file? }
+ end
+
# @private
# The `LinkedKegs` directory for this {Formula}.
# You probably want {#opt_prefix} instead.