aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorDan Loewenherz2011-06-03 21:11:47 -0700
committerAdam Vandenberg2011-06-07 13:38:15 -0700
commit58bdd8324535c9c6b7018d35ea4e8855d0943700 (patch)
tree2470af4cdeca26d471faf2873af06f2e829dcfdc /Library
parent73aee602255df40e083397fbbfc6aaca701997c8 (diff)
downloadhomebrew-58bdd8324535c9c6b7018d35ea4e8855d0943700.tar.bz2
Add HOMEBREW_CACHE to let the user specify a cache directory
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/global.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb
index f248ce36e..54b169d75 100644
--- a/Library/Homebrew/global.rb
+++ b/Library/Homebrew/global.rb
@@ -10,7 +10,9 @@ ARGV.extend(HomebrewArgvExtension)
HOMEBREW_VERSION = '0.8'
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*
# so in that case, maybe we should always use it, root or not?
Pathname.new("/Library/Caches/Homebrew")