aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2011-09-15 10:57:03 +0100
committerMax Howell2011-09-15 10:57:22 +0100
commit95ce00729cda1ed9aa1cf1041f3c7fdc89731d3e (patch)
tree31b9adfc210d7b0884925f870164ee717ff0d408 /Library
parentf4c301a82765a740f0d880504f549abdbce64929 (diff)
downloadbrew-95ce00729cda1ed9aa1cf1041f3c7fdc89731d3e.tar.bz2
Check Cellar can be made before installing stuff
Refs Homebrew/homebrew#5188.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/install.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb
index ffaf34480..7142a5fcb 100644
--- a/Library/Homebrew/cmd/install.rb
+++ b/Library/Homebrew/cmd/install.rb
@@ -62,11 +62,21 @@ module Homebrew extend self
end
end
+ def check_cellar
+ FileUtils.mkdir_p HOMEBREW_CELLAR if not File.exist? HOMEBREW_CELLAR
+ rescue
+ raise <<-EOS.undent
+ Could not create #{HOMEBREW_CELLAR}
+ Check you have permission to write to #{HOMEBREW_CELLAR.parent}
+ EOS
+ end
+
def perform_preinstall_checks
check_ppc
check_writable_install_location
check_cc
check_macports
+ check_cellar
end
def install_formulae formulae