class Chef::Resource::HomebrewTap

Public Instance Methods

tapped?(name) click to toggle source

Is the passed tap already tapped

@return [Boolean]

# File lib/chef/resource/homebrew_tap.rb, line 76
def tapped?(name)
  base_path = ["#{::File.dirname(which("brew"))}/../homebrew", "#{::File.dirname(which("brew"))}/../Homebrew", "/opt/homebrew", "/usr/local/Homebrew", "/home/linuxbrew/.linuxbrew"].uniq.select { |x| Dir.exist?(x) }.first
  tap_dir = name.gsub("/", "/homebrew-")
  ::File.directory?("#{base_path}/Library/Taps/#{tap_dir}")
end