From d81359246a9e7bbd44ce807f3f3deefc8d18ec23 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 25 Mar 2022 20:14:41 +0000 Subject: [PATCH] DEV: Be more lenient in CLI confirmation (#16290) If someone types `yes` rather than `YES`, continue anyway. The chance of typing `yes`, when you actually want to stop, is non-existent. The chance of typing `yes` when you meant `YES` is high, and it's very frustrating when the script quite because you got the case wrong! --- script/discourse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/discourse b/script/discourse index 03c40195406..4127d666112 100755 --- a/script/discourse +++ b/script/discourse @@ -45,7 +45,7 @@ class DiscourseCLI < Thor puts "THIS TASK WILL REWRITE DATA, ARE YOU SURE (type YES)" puts "WILL RUN ON ALL #{RailsMultisite::ConnectionManagement.all_dbs.length} DBS" if options[:global] text = STDIN.gets - if text.strip != "YES" + if text.strip.upcase != "YES" puts "aborting." exit 1 end