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!
This commit is contained in:
David Taylor 2022-03-25 20:14:41 +00:00 committed by GitHub
parent 6eb3d658ca
commit d81359246a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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