Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Commit

Permalink
Merge pull request #86 from boxen/default-paths
Browse files Browse the repository at this point in the history
Use default Homebrew paths unless Boxen's exists.
  • Loading branch information
MikeMcQuaid committed Aug 18, 2015
2 parents 3537c38 + d49adf3 commit 4de455d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/facter/homebrew_root.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@
# Explicit, low weight makes this easily overridable
has_weight 1

setcode { "#{Facter.value(:boxen_home)}/homebrew" }
setcode do
if File.exist? "#{Facter.value(:boxen_home)}/homebrew/bin/brew"
"#{Facter.value(:boxen_home)}/homebrew"
else
"/usr/local"
end
end
end
3 changes: 2 additions & 1 deletion lib/puppet/provider/package/homebrew.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def self.home
end

def self.cache
if boxen_home = Facter.value(:boxen_home)
boxen_home = Facter.value(:boxen_home)
if boxen_home && File.exist?("#{boxen_home}/cache/homebrew")
"#{boxen_home}/cache/homebrew"
else
ENV["HOMEBREW_CACHE"] || "/Library/Caches/Homebrew"
Expand Down

0 comments on commit 4de455d

Please sign in to comment.