Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Converts AWS_CREDENTIAL_FILE to a .fog one
#!/usr/bin/env ruby
require 'yaml'
unless filename = ENV['AWS_CREDENTIAL_FILE']
puts "No AWS_CREDENTIAL_FILE file found!"
exit 1
credentials = Hash[ { |line| line.chomp.split('=') }]
econ = {
'econsultancy' =>
'aws_access_key_id' => credentials['AWSAccessKeyId'],
'aws_secret_access_key' => credentials['AWSSecretKey']
file = File.expand_path('.fog', '~'), 'w') { |f| f.write econ.to_yaml }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment