Skip to content

Commit

Permalink
DEV: Be more lenient in CLI confirmation (discourse#16290)
Browse files Browse the repository at this point in the history
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!
  • Loading branch information
davidtaylorhq authored Mar 25, 2022
1 parent 6eb3d65 commit d813592
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion script/discourse
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d813592

Please sign in to comment.