allow passing a command line argument for credentials file

This commit is contained in:
Wesley Beary 2009-10-05 14:53:33 -07:00
parent 27deaf7a94
commit 121f4ed8e5
1 changed files with 3 additions and 1 deletions

View File

@ -3,7 +3,9 @@ require File.join(File.dirname(__FILE__), '..', 'lib', 'fog')
require 'irb'
require 'yaml'
if File.exists?(File.expand_path('~/.fog'))
if ARGV[0] && File.exists?(File.expand_path(ARGV[0]))
@credentials = YAML.load(File.open(File.expand_path(ARGV[0])).read)
elsif File.exists?(File.expand_path('~/.fog'))
@credentials = YAML.load(File.open(File.expand_path('~/.fog')).read)
end