lib/atcoder_greedy/command/config.rb in atcoder_greedy-0.3.1 vs lib/atcoder_greedy/command/config.rb in atcoder_greedy-0.4.0
- old
+ new
@@ -10,11 +10,12 @@
config_path = Dir.home + '/.atcoder_greedy'
if Dir.exists?(config_path)
puts "Your current language is [#{AtcoderGreedy.config[:language]}]."
else
Dir.mkdir(config_path)
- File.new(config_path + '/settings.yml', 'w')
+ yml_path = AtcoderGreedy.get_config_path + '/settings.yml'
+ File.open(yml_path, 'w').close
end
puts "Choose default language from: #{languages}"
print "Input languages: "
loop do
s = $stdin.gets.chomp!
@@ -25,10 +26,9 @@
break
elsif puts "Invalid language. please try again:"
end
end
- AtcoderGreedy.save_config
puts "Update Your default language to [#{AtcoderGreedy.config[:language]}]."
end
end
end