diff options
| author | Charlie Sharpsteen | 2012-09-24 16:34:29 -0500 | 
|---|---|---|
| committer | Charlie Sharpsteen | 2012-09-24 16:34:29 -0500 | 
| commit | 0019042efdc2cbfedd2e7bd5f311166ac70c5b88 (patch) | |
| tree | 42da81cc50f2514e5ca7d38f52ebb23474ea45d5 | |
| parent | 5608ad6dae59a3e2bcf45ee705a37ec20cd8e290 (diff) | |
| download | homebrew-0019042efdc2cbfedd2e7bd5f311166ac70c5b88.tar.bz2 | |
Notify user of how to abort installation
Notify users that hitting any key other than ENTER will abort the installer.
| -rw-r--r-- | install | 16 | 
1 files changed, 9 insertions, 7 deletions
| @@ -55,6 +55,14 @@ ensure    system "/bin/stty -raw echo"  end +def wait_for_user +  puts +  puts "Press ENTER to continue or any other key to abort" +  c = getc +  # we test for \r and \n because some stuff does \r instead +  abort unless c == 13 or c == 10 +end +  def macos_version    @macos_version ||= /(10\.\d+)(\.\d+)?/.match(`/usr/bin/sw_vers -productVersion`).captures.first.to_f  end @@ -120,13 +128,7 @@ unless chgrps.empty?    puts *chgrps  end -if STDIN.tty? -  puts -  puts "Press enter to continue" -  c = getc -  # we test for \r and \n because some stuff does \r instead -  abort unless c == 13 or c == 10 -end +wait_for_user if STDIN.tty?  if File.directory? HOMEBREW_PREFIX    sudo "/bin/chmod", "g+rwx", *chmods unless chmods.empty? | 
