Method: CloudFormationTool#find_profile

Defined in:
lib/cloud_formation_tool.rb

#find_profile(dir = nil, default = nil) ⇒ Object



64
65
66
67
68
69
70
71
72
# File 'lib/cloud_formation_tool.rb', line 64

def find_profile(dir = nil, default = nil)
  dir ||= Dir.pwd
  return default if (dir == "/")
  begin
    return File.read("#{dir}/.awsprofile").chomp
  rescue Errno::ENOENT
    return find_profile(File.dirname(dir))
  end
end