From 9c5ad5c978cb4cad86e264a739cc35bf1391e317 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 15 Aug 2011 12:28:17 +0100 Subject: [PATCH] Error out with link to help if OS X < 10.5 --- install_homebrew.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install_homebrew.rb b/install_homebrew.rb index 540c7e0f20..c172f058f1 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"