Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Notify user of how to abort installation

Notify users that hitting any key other than ENTER will abort the installer.
  • Loading branch information...
commit 0019042efdc2cbfedd2e7bd5f311166ac70c5b88 1 parent 5608ad6
Charlie Sharpsteen authored
Showing with 9 additions and 7 deletions.
  1. +9 −7 install
16 install
View
@@ -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?
Please sign in to comment.
Something went wrong with that request. Please try again.