From 17cfa811ca2bd22d06960bb009e11ae6251b3361 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 29 Aug 2012 08:41:08 -0400 Subject: Better message if /usr/local/.git exists --- install | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/install b/install index c8a35fee3..647cda6a0 100644 --- a/install +++ b/install @@ -73,7 +73,6 @@ Dir.chdir "/usr" ####################################################################### 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? "admin" This script requires the user #{ENV['USER']} to be an Administrator. If this @@ -82,11 +81,15 @@ you please; please refer to our homepage. If you still want to use this script set your user to be an Administrator in System Preferences or `su' to a non-root user with Administrator privileges. EOABORT +abort <<-EOABORT unless Dir["/usr/local/.git/*"].empty? +It appears Homebrew is already installed. If your intent is to reinstall you +should do the following before running this installer again: + rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup +EOABORT ohai "This script will install:" puts "/usr/local/bin/brew" -puts "/usr/local/Library/Formula/..." -puts "/usr/local/Library/Homebrew/..." +puts "/usr/local/Library/..." puts "/usr/local/share/man/man1/brew.1" chmods = %w( . bin etc include lib lib/pkgconfig Library sbin share var var/log share/locale share/man -- cgit v1.2.3