bin/mayaml-mutt-creds in mayaml-mutt-1.0.0 vs bin/mayaml-mutt-creds in mayaml-mutt-1.1.0
- old
+ new
@@ -25,22 +25,28 @@
Ussage: mayaml-mutt-init <path_to_yaml_file> [<accounts_destination_dir>]
END_HELP
end
def present_configs(configs)
+ default_acc = configs.delete(:default)
+ puts "### Default account: #{default_acc}"
configs.each do |name, config|
puts "### Name: #{name} " + "=" * 50
puts config
puts
end
end
def store_configs(configs, destination_dir)
FileUtils.mkdir_p destination_dir
+ default_acc = configs.delete(:default)
configs.each do |name, config|
file_path = File.join destination_dir, name.to_s
File.open(file_path, "w") { |f| f.write(config) }
end
+ FileUtils.ln_s(
+ File.join(destination_dir, default_acc), File.join(destination_dir, "current_acc")
+ )
end
def check_yaml_path(yaml_path)
if yaml_path.nil?
puts_ussage_message