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

Commit 4de455d

Browse files
committed
Merge pull request #86 from boxen/default-paths
Use default Homebrew paths unless Boxen's exists.
2 parents 3537c38 + d49adf3 commit 4de455d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/facter/homebrew_root.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,11 @@
44
# Explicit, low weight makes this easily overridable
55
has_weight 1
66

7-
setcode { "#{Facter.value(:boxen_home)}/homebrew" }
7+
setcode do
8+
if File.exist? "#{Facter.value(:boxen_home)}/homebrew/bin/brew"
9+
"#{Facter.value(:boxen_home)}/homebrew"
10+
else
11+
"/usr/local"
12+
end
13+
end
814
end

lib/puppet/provider/package/homebrew.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def self.home
1818
end
1919

2020
def self.cache
21-
if boxen_home = Facter.value(:boxen_home)
21+
boxen_home = Facter.value(:boxen_home)
22+
if boxen_home && File.exist?("#{boxen_home}/cache/homebrew")
2223
"#{boxen_home}/cache/homebrew"
2324
else
2425
ENV["HOMEBREW_CACHE"] || "/Library/Caches/Homebrew"

0 commit comments

Comments
 (0)