diff --git a/bin/crew b/bin/crew index 1ffe9c6c7..6c3e2b2e0 100755 --- a/bin/crew +++ b/bin/crew @@ -1405,11 +1405,11 @@ def resolve_dependencies puts @dependencies.join(' ') print 'Do you agree? [Y/n] ' - response = $stdin.getc + response = $stdin.gets.chomp.downcase case response - when 'n' + when 'n', 'no' abort 'No changes made.' - when "\n", 'y', 'Y' + when '', 'y', 'yes' puts 'Proceeding...' else puts "I don't understand `#{response}`. :(".lightred diff --git a/lib/const.rb b/lib/const.rb index 66d11f8fa..b1e79369a 100644 --- a/lib/const.rb +++ b/lib/const.rb @@ -1,6 +1,6 @@ # Defines common constants used in different parts of crew -CREW_VERSION = '1.30.6' +CREW_VERSION = '1.30.7' # kernel architecture KERN_ARCH = `uname -m`.chomp diff --git a/packages/android_studio.rb b/packages/android_studio.rb index 415e73a96..a597fe081 100644 --- a/packages/android_studio.rb +++ b/packages/android_studio.rb @@ -37,13 +37,13 @@ class Android_studio < Package def self.remove print 'Would you like to remove the config directories? [y/N] ' - response = $stdin.getc + response = $stdin.gets.chomp.downcase config_dirs = ["#{HOME}/.android", "#{HOME}/Android"] config_dirs.each do |config_dir| next unless Dir.exist? config_dir case response - when 'y', 'Y' + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/bluefish.rb b/packages/bluefish.rb index 12b755d79..9a2535c9d 100644 --- a/packages/bluefish.rb +++ b/packages/bluefish.rb @@ -63,8 +63,8 @@ class Bluefish < Package if Dir.exist? config_dir puts 'WARNING: This will remove all bluefish config!'.orange print "Would you like to remove the #{config_dir} directory? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightgreen else diff --git a/packages/cheat.rb b/packages/cheat.rb index 8c82e8dc9..ce9ed0e9e 100644 --- a/packages/cheat.rb +++ b/packages/cheat.rb @@ -33,8 +33,8 @@ class Cheat < Package if Dir.exist? config_dir puts 'WARNING: This will remove all cheat config!'.orange print "Would you like to remove the #{config_dir} directory? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightgreen else diff --git a/packages/clamav.rb b/packages/clamav.rb index d1033653f..e3a1e915f 100644 --- a/packages/clamav.rb +++ b/packages/clamav.rb @@ -71,8 +71,8 @@ class Clamav < Package if Dir.exist? config_dir puts 'WARNING: This will remove the clamav database!'.orange print "Would you like to remove the #{config_dir} directory? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightgreen else diff --git a/packages/clamtk.rb b/packages/clamtk.rb index 950b330eb..6210c3bfe 100644 --- a/packages/clamtk.rb +++ b/packages/clamtk.rb @@ -82,8 +82,8 @@ class Clamtk < Package if Dir.exist? config_dir puts 'WARNING: This will remove all clamtk config!'.orange print "Would you like to remove the #{config_dir} directory? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightgreen else diff --git a/packages/dbeaver.rb b/packages/dbeaver.rb index 0ea53999f..b9fef14d5 100644 --- a/packages/dbeaver.rb +++ b/packages/dbeaver.rb @@ -42,8 +42,8 @@ class Dbeaver < Package config_dir = "#{HOME}/.local/share/DBeaverData" if Dir.exist? config_dir print "Would you like to remove the #{config_dir} directory? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/dosbox.rb b/packages/dosbox.rb index 10bbd997a..9b32868a0 100644 --- a/packages/dosbox.rb +++ b/packages/dosbox.rb @@ -43,11 +43,11 @@ class Dosbox < Package def self.remove print 'Would you like to remove the config directory? [y/N] ' - response = $stdin.getc + response = $stdin.gets.chomp.downcase config_dir = "#{HOME}/.dosbox" if Dir.exist? config_dir case response - when 'y', 'Y' + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/electric.rb b/packages/electric.rb index 8a3a241c1..539b1b39f 100644 --- a/packages/electric.rb +++ b/packages/electric.rb @@ -37,8 +37,8 @@ class Electric < Package log_file = "#{HOME}/electric.log" if File.exist? log_file print "Would you like to remove #{log_file}? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_f log_file puts "#{log_file} removed.".lightred else diff --git a/packages/exodus.rb b/packages/exodus.rb index 72053084c..5612cbd29 100644 --- a/packages/exodus.rb +++ b/packages/exodus.rb @@ -35,8 +35,8 @@ class Exodus < Package if Dir.exist? config_dir puts 'WARNING: This will remove all Exodus data!'.orange print "Would you like to remove the #{config_dir} directory? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightgreen else diff --git a/packages/ferdi.rb b/packages/ferdi.rb index ec40b3e6e..d72c1a026 100644 --- a/packages/ferdi.rb +++ b/packages/ferdi.rb @@ -44,8 +44,8 @@ class Ferdi < Package config_dir = "#{HOME}/.config/autostart" if Dir.exist? config_dir print "Would you like to remove the config directory #{config_dir}? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/firefox.rb b/packages/firefox.rb index 5146c9de7..699ccd696 100644 --- a/packages/firefox.rb +++ b/packages/firefox.rb @@ -97,8 +97,8 @@ class Firefox < Package def self.postinstall print "\nSet Firefox as your default browser? [Y/n]: " - case $stdin.getc - when "\n", 'Y', 'y' + case $stdin.gets.chomp.downcase + when '', 'y', 'yes' Dir.chdir("#{CREW_PREFIX}/bin") do FileUtils.ln_sf 'firefox', 'x-www-browser' end diff --git a/packages/flutter.rb b/packages/flutter.rb index 87b597dd7..1c8654bd4 100644 --- a/packages/flutter.rb +++ b/packages/flutter.rb @@ -33,13 +33,13 @@ class Flutter < Package def self.remove print 'Would you like to remove the config directories? [y/N] ' - response = $stdin.getc + response = $stdin.gets.chomp.downcase config_dirs = ["#{HOME}/.flutter", "#{CREW_PREFIX}/share/flutter"] config_dirs.each do |config_dir| next unless Dir.exist? config_dir case response - when 'y', 'Y' + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/fpc.rb b/packages/fpc.rb index 26215d1ba..53ab6154d 100644 --- a/packages/fpc.rb +++ b/packages/fpc.rb @@ -48,11 +48,11 @@ class Fpc < Package def self.remove print 'Would you like to remove the config directories? [y/N] ' - response = $stdin.getc + response = $stdin.gets.chomp.downcase config_dirs = ["#{HOME}/.fpc.cfg", "#{HOME}/.config/fppkg.cfg", "#{HOME}/.fppkg"] config_dirs.each do |config_dir| case response - when 'y', 'Y' + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/freecad.rb b/packages/freecad.rb index 473ba7080..0e1277944 100644 --- a/packages/freecad.rb +++ b/packages/freecad.rb @@ -49,8 +49,8 @@ class Freecad < Package config_dir = "#{HOME}/.FreeCAD" if Dir.exist? config_dir.to_s print "\nWould you like to remove #{config_dir}? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir.to_s puts "#{config_dir} removed.".lightred else diff --git a/packages/gcloud.rb b/packages/gcloud.rb index eb4be4827..4e7339820 100644 --- a/packages/gcloud.rb +++ b/packages/gcloud.rb @@ -56,13 +56,13 @@ class Gcloud < Package def self.remove print 'Would you like to remove the config directories? [y/N] ' - response = $stdin.getc + response = $stdin.gets.chomp.downcase config_dirs = ["#{HOME}/.config/gcloud", "#{CREW_PREFIX}/share/gcloud"] config_dirs.each do |config_dir| next unless Dir.exist? config_dir case response - when 'y', 'Y' + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/geany.rb b/packages/geany.rb index ad30e6273..2226d4a80 100644 --- a/packages/geany.rb +++ b/packages/geany.rb @@ -66,8 +66,8 @@ class Geany < Package next unless Dir.exist? config_dir print "\nWould you like to remove #{config_dir}? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/github_desktop.rb b/packages/github_desktop.rb index cd67bc848..ad94dc18d 100644 --- a/packages/github_desktop.rb +++ b/packages/github_desktop.rb @@ -46,8 +46,8 @@ class Github_desktop < Package if Dir.exist? config_dir.to_s system "echo '#{config_dir}'; ls '#{config_dir}'" print "\nWould you like to remove the config directories above? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "'#{config_dir}' removed.".lightred else diff --git a/packages/gvim.rb b/packages/gvim.rb index f66a2fbf7..1f8ea0882 100644 --- a/packages/gvim.rb +++ b/packages/gvim.rb @@ -112,8 +112,8 @@ class Gvim < Package @create_vi_symlink_ask = true if @crew_vi || @system_vi if @create_vi_symlink_ask print "\nWould you like to set vim to be the default vi [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' @create_vi_symlink = true else @create_vi_symlink = false diff --git a/packages/idea.rb b/packages/idea.rb index 41d8fb74a..c5818a368 100644 --- a/packages/idea.rb +++ b/packages/idea.rb @@ -37,13 +37,13 @@ class Idea < Package def self.remove print 'Would you like to remove the config directories? [y/N] ' - response = $stdin.getc + response = $stdin.gets.chomp.downcase config_dirs = ["#{CREW_PREFIX}/.config/JetBrains/.IdeaIC2022.3", "#{HOME}/.IdeaIC2022.3"] config_dirs.each do |config_dir| next unless Dir.exist? config_dir case response - when 'y', 'Y' + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/imagemagick.rb b/packages/imagemagick.rb index b76cb1ded..76f48023e 100644 --- a/packages/imagemagick.rb +++ b/packages/imagemagick.rb @@ -18,7 +18,7 @@ class Imagemagick < Package puts ' 7 = ImageMagick 7.0.11-2' puts ' 0 = Cancel' - while version = $stdin.gets.chomp + while version = $stdin.gets.chomp.downcase case version when '6' depends_on 'imagemagick6' diff --git a/packages/komodo.rb b/packages/komodo.rb index 2fc4a81d2..056573383 100644 --- a/packages/komodo.rb +++ b/packages/komodo.rb @@ -25,13 +25,13 @@ class Komodo < Package def self.remove print 'Would you like to remove the config directories? [y/N] ' - response = $stdin.getc + response = $stdin.gets.chomp.downcase config_dirs = ["#{HOME}/.komodoide", "#{HOME}/.activestate"] config_dirs.each do |config_dir| next unless Dir.exist? config_dir case response - when 'y', 'Y' + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/leiningen.rb b/packages/leiningen.rb index e8cf11d73..e757f4bd2 100644 --- a/packages/leiningen.rb +++ b/packages/leiningen.rb @@ -24,8 +24,8 @@ class Leiningen < Package config_dir = "#{HOME}/.lein" if Dir.exist? config_dir print "Would you like to remove the #{config_dir} directory? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/mysql.rb b/packages/mysql.rb index aa26c914d..037b2821d 100644 --- a/packages/mysql.rb +++ b/packages/mysql.rb @@ -63,8 +63,8 @@ class Mysql < Package if Dir.exist? data_dir.to_s puts "\nWARNING: This will delete all your databases!".orange print "Would you like to remove #{data_dir}? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf data_dir.to_s puts "#{data_dir} removed.".lightred else diff --git a/packages/natron.rb b/packages/natron.rb index 8732ae408..40ab82e99 100644 --- a/packages/natron.rb +++ b/packages/natron.rb @@ -39,8 +39,8 @@ class Natron < Package config_dir = "#{HOME}/.Natron" if Dir.exist? config_dir print "Would you like to remove the config directory #{config_dir}? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/neovim.rb b/packages/neovim.rb index 136325c44..c7ce0f088 100644 --- a/packages/neovim.rb +++ b/packages/neovim.rb @@ -59,8 +59,8 @@ class Neovim < Package @create_vi_symlink_ask = true if @crew_vi || @system_vi if @create_vi_symlink_ask print "\nWould you like to set nvim to be the default vi [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' @create_vi_symlink = true else @create_vi_symlink = false diff --git a/packages/netbeans.rb b/packages/netbeans.rb index c32f3bd55..0096e4e6d 100644 --- a/packages/netbeans.rb +++ b/packages/netbeans.rb @@ -30,8 +30,8 @@ class Netbeans < Package config_dir = "#{HOME}/.netbeans" if Dir.exist? config_dir print "Would you like to remove the config directory #{config_dir}? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightgreen else diff --git a/packages/newsboat.rb b/packages/newsboat.rb index ed64357bc..f077db76d 100644 --- a/packages/newsboat.rb +++ b/packages/newsboat.rb @@ -52,8 +52,8 @@ class Newsboat < Package config_dir = "#{HOME}/.newsboat" if Dir.exist? config_dir print "Would you like to remove the config directory #{config_dir}? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/nginx.rb b/packages/nginx.rb index 537d8cb88..582786601 100644 --- a/packages/nginx.rb +++ b/packages/nginx.rb @@ -85,9 +85,9 @@ class Nginx < Package if Dir.exist? "#{CREW_PREFIX}/share/nginx" puts print "Would you like to remove #{CREW_PREFIX}/share/nginx? [y/N] " - response = $stdin.getc + response = $stdin.gets.chomp.downcase case response - when 'y', 'Y' + when 'y', 'yes' FileUtils.rm_rf "#{CREW_PREFIX}/share/nginx" puts "#{CREW_PREFIX}/share/nginx removed.".lightred else diff --git a/packages/nodebrew.rb b/packages/nodebrew.rb index c2e60450c..4fce3cf13 100644 --- a/packages/nodebrew.rb +++ b/packages/nodebrew.rb @@ -82,9 +82,9 @@ class Nodebrew < Package if Dir.exist? "#{CREW_PREFIX}/share/nodebrew" puts print "Would you like to remove #{CREW_PREFIX}/share/nodebrew? [y/N] " - response = $stdin.getc + response = $stdin.gets.chomp.downcase case response - when 'y', 'Y' + when 'y', 'yes' FileUtils.rm_rf "#{CREW_PREFIX}/share/nodebrew" puts "#{CREW_PREFIX}/share/nodebrew removed.".lightred else diff --git a/packages/opam.rb b/packages/opam.rb index eb8ea89ac..84c8edbca 100644 --- a/packages/opam.rb +++ b/packages/opam.rb @@ -60,9 +60,9 @@ class Opam < Package puts print "Would you like to remove #{@OPAMROOT}? [y/N] " - response = $stdin.getc + response = $stdin.gets.chomp.downcase case response - when 'y', 'Y' + when 'y', 'yes' FileUtils.rm_rf @OPAMROOT puts "#{@OPAMROOT} removed.".lightred else diff --git a/packages/opera.rb b/packages/opera.rb index 92ebc4c8c..1b0098038 100644 --- a/packages/opera.rb +++ b/packages/opera.rb @@ -38,8 +38,8 @@ class Opera < Package def self.postinstall puts print 'Set Opera as your default browser? [Y/n]: ' - case $stdin.getc - when "\n", 'Y', 'y' + case $stdin.gets.chomp.downcase + when '', 'y', 'yes' Dir.chdir("#{CREW_PREFIX}/bin") do FileUtils.ln_sf "#{CREW_LIB_PREFIX}/opera/opera", 'x-www-browser' end diff --git a/packages/php.rb b/packages/php.rb index 03c620f7d..aa71f9549 100644 --- a/packages/php.rb +++ b/packages/php.rb @@ -28,7 +28,7 @@ class Php < Package puts '8.2 = PHP 8.2.1' puts ' 0 = Cancel' - while version = $stdin.gets.chomp + while version = $stdin.gets.chomp.downcase case version when '5.6' depends_on 'php5' diff --git a/packages/postgres.rb b/packages/postgres.rb index 6cf40c563..3270bef3d 100644 --- a/packages/postgres.rb +++ b/packages/postgres.rb @@ -75,8 +75,8 @@ class Postgres < Package if Dir.exist? PGDATA puts 'WARNING: This will delete all databases!'.orange print "Would you like to remove #{PGDATA}? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf PGDATA FileUtils.rm_rf "#{CREW_PREFIX}/pgsql" puts "#{PGDATA} removed.".lightred diff --git a/packages/pycharm.rb b/packages/pycharm.rb index ddabf66f4..b14fe91cb 100644 --- a/packages/pycharm.rb +++ b/packages/pycharm.rb @@ -37,8 +37,8 @@ class Pycharm < Package if Dir.exist? config_dir puts 'WARNING: This will remove all PyCharm config!'.orange print "Would you like to remove the #{config_dir} directory? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/rust.rb b/packages/rust.rb index 9263c5a37..edbcdf9d9 100644 --- a/packages/rust.rb +++ b/packages/rust.rb @@ -80,8 +80,8 @@ class Rust < Package config_dirs = %W[#{HOME}/.rustup #{CREW_PREFIX}/share/rustup #{HOME}/.cargo #{CREW_PREFIX}/share/cargo] print config_dirs.to_s print "\nWould you like to remove the config directories above? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dirs puts "#{config_dirs} removed.".lightgreen else diff --git a/packages/snowflake.rb b/packages/snowflake.rb index cf4252933..7c79d920c 100644 --- a/packages/snowflake.rb +++ b/packages/snowflake.rb @@ -45,8 +45,8 @@ class Snowflake < Package if Dir.exist? config_dir puts 'WARNING: This will remove all saved ssh sessions!'.orange print "Would you like to remove the #{config_dir} directory? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/stellarium.rb b/packages/stellarium.rb index 134359099..de8a4ede8 100644 --- a/packages/stellarium.rb +++ b/packages/stellarium.rb @@ -45,8 +45,8 @@ class Stellarium < Package config_dir = "#{HOME}/.stellarium" if Dir.exist? config_dir print "Would you like to remove the config directory #{config_dir}? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else diff --git a/packages/teams.rb b/packages/teams.rb index 68ace920f..69e35f4d4 100644 --- a/packages/teams.rb +++ b/packages/teams.rb @@ -46,8 +46,8 @@ class Teams < Package system "echo '#{config_dir}'; ls '#{config_dir}'" end print "\nWould you like to remove the config directories above? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' config_dirs.each do |config_dir| next unless Dir.exist? config_dir diff --git a/packages/torbrowser.rb b/packages/torbrowser.rb index b5a5b8990..dd2ec0fe2 100644 --- a/packages/torbrowser.rb +++ b/packages/torbrowser.rb @@ -43,8 +43,8 @@ class Torbrowser < Package def self.postinstall print "\nSet Tor as your default browser? [Y/n]: " - case $stdin.getc - when "\n", 'Y', 'y' + case $stdin.gets.chomp.downcase + when '', 'y', 'yes' Dir.chdir("#{CREW_PREFIX}/bin") do FileUtils.ln_sf 'tor', 'x-www-browser' end diff --git a/packages/uwsgi.rb b/packages/uwsgi.rb index 5b4ad465c..63f9a1d11 100644 --- a/packages/uwsgi.rb +++ b/packages/uwsgi.rb @@ -21,7 +21,7 @@ class Uwsgi < Package system "echo 'Select plugin(s):' && ls plugins" puts system "echo -n 'Enter selection (separate multiple plugins by a space) [python]: '" - plugins = $stdin.gets.chomp + plugins = $stdin.gets.chomp.downcase puts system "make #{plugins}" end diff --git a/packages/vim.rb b/packages/vim.rb index 16c7a810b..d87af959a 100644 --- a/packages/vim.rb +++ b/packages/vim.rb @@ -104,8 +104,8 @@ class Vim < Package @create_vi_symlink_ask = true if @crew_vi || @system_vi if @create_vi_symlink_ask print "\nWould you like to set vim to be the default vi [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' @create_vi_symlink = true else @create_vi_symlink = false diff --git a/packages/vuze.rb b/packages/vuze.rb index a3ccdda3c..52339c452 100644 --- a/packages/vuze.rb +++ b/packages/vuze.rb @@ -66,8 +66,8 @@ class Vuze < Package system "echo '#{config_dir}'; ls '#{config_dir}'" end print "\nWould you like to remove the config directories above? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' config_dirs.each do |config_dir| next unless Dir.exist? config_dir diff --git a/packages/wine.rb b/packages/wine.rb index 51cab2b8f..7818e4c68 100644 --- a/packages/wine.rb +++ b/packages/wine.rb @@ -104,8 +104,8 @@ class Wine < Package next unless Dir.exist? config_dir print "\nWould you like to remove #{config_dir}? [y/N] " - case $stdin.getc - when 'y', 'Y' + case $stdin.gets.chomp.downcase + when 'y', 'yes' FileUtils.rm_rf config_dir puts "#{config_dir} removed.".lightred else