aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2011-08-15 12:28:17 +0100
committerMax Howell2012-03-09 12:10:49 +0000
commit9c5ad5c978cb4cad86e264a739cc35bf1391e317 (patch)
tree8effc2d712ddf0940eb4efe98e7748e5fa80376b
parentc1568ab27746d993ec2d25276c625e42297d7555 (diff)
downloadbrew-9c5ad5c978cb4cad86e264a739cc35bf1391e317.tar.bz2
Error out with link to help if OS X < 10.5
-rw-r--r--install_homebrew.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/install_homebrew.rb b/install_homebrew.rb
index 540c7e0f2..c172f058f 100644
--- a/install_homebrew.rb
+++ b/install_homebrew.rb
@@ -62,7 +62,12 @@ def badlibs
end
end
+def macos_version
+ @macos_version ||= /(10\.\d+)(\.\d+)?/.match(`/usr/bin/sw_vers -productVersion`).captures.first.to_f
+end
+
####################################################################### script
+abort "MacOS too old, see: https://gist.github.com/1144389" if macos_version < 10.5
abort "/usr/local/.git already exists!" unless Dir["/usr/local/.git/*"].empty?
abort "Don't run this as root!" if Process.uid == 0
abort <<-EOABORT unless `groups`.split.include? "staff"