Add HOMEBREW_CACHE to let the user specify a cache directory

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Dan Loewenherz 2011-06-03 21:11:47 -07:00 committed by Adam Vandenberg
parent b15be6965d
commit 6495505f88

View File

@ -10,7 +10,9 @@ ARGV.extend(HomebrewArgvExtension)
HOMEBREW_VERSION = '0.8' HOMEBREW_VERSION = '0.8'
HOMEBREW_WWW = 'http://mxcl.github.com/homebrew/' HOMEBREW_WWW = 'http://mxcl.github.com/homebrew/'
HOMEBREW_CACHE = if Process.uid == 0 HOMEBREW_CACHE = if ENV['HOMEBREW_CACHE']
Pathname.new(ENV['HOMEBREW_CACHE'])
elsif Process.uid == 0
# technically this is not the correct place, this cache is for *all users* # technically this is not the correct place, this cache is for *all users*
# so in that case, maybe we should always use it, root or not? # so in that case, maybe we should always use it, root or not?
Pathname.new("/Library/Caches/Homebrew") Pathname.new("/Library/Caches/Homebrew")