Skip to content

Instantly share code, notes, and snippets.

@jim
Created July 13, 2010 17:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jim/474211 to your computer and use it in GitHub Desktop.
Save jim/474211 to your computer and use it in GitHub Desktop.
# see http://www.aeonscope.net/2010/02/22/managing-multiple-heroku-accounts/
# INTRODUCTION
# This script echos the active Heroku credentials (useful when switching between multiple Heroku accounts
# and remembering which one is active).
# USAGE
# ruby credentials.rb
# CONFIGURATION
HEROKU_HOME = File.join ENV["HOME"], ".heroku"
CREDENTIALS_FILE = "credentials"
# EXECUTION
credentials_path = File.join HEROKU_HOME, CREDENTIALS_FILE
if File.exists? credentials_path
credentials = `cat #{credentials_path}`.split("\n")
puts "\nYour active Heroku credentials are:\n\n"
puts credentials.first
puts "*" * credentials.last.size
puts "\nSource: #{credentials_path}\n\n"
else
puts "ERROR: Heroku credentials not found!"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment