Improve the ask for creating PGN directory.

This commit is contained in:
vonavi 2013-09-18 12:54:16 +03:00
parent 0c24e23aca
commit fadc968ba1

View File

@ -62,7 +62,8 @@ namespace :pgn do
if Dir.exists? dir if Dir.exists? dir
puts "PGN directory exists" puts "PGN directory exists"
else else
puts "Directory \"#{dir.shellescape}\" doesn't exist. Create it?" puts "Directory \"#{dir.shellescape}\" doesn't exist"
print "Create the directory? "
answer = $stdin.gets.chomp answer = $stdin.gets.chomp
if ['Yes', 'yes', 'y'].include? answer if ['Yes', 'yes', 'y'].include? answer
FileUtils.mkdir_p dir FileUtils.mkdir_p dir