lib/aocli/commands/save_cookie.rb in aocli-1.4.5 vs lib/aocli/commands/save_cookie.rb in aocli-1.5.0
- old
+ new
@@ -1,10 +1,9 @@
module Aocli
module Commands
module SaveCookie
def self.run!(options)
- Aocli::FileUtils.touch_file(Aocli::Values::CONFIG_FILE_PATH)
- File.write(Aocli::Values::CONFIG_FILE_PATH, {cookie: options[:cookie]}.to_yaml)
+ Aocli::Config.add_config(key: :cookie, value: options[:cookie])
puts <<~MSG
### Cookie saved to #{Aocli::Values::CONFIG_FILE_PATH} ###
If you ever need to reset this cookie, you can use the save cookie command again