зеркало из https://github.com/microsoft/fog.git
fix credentials hinting for bin file
This commit is contained in:
Родитель
7519f5f823
Коммит
92924c7e26
2
bin/fog
2
bin/fog
|
@ -19,7 +19,7 @@ module Fog
|
|||
|
||||
YML
|
||||
print(yml)
|
||||
raise ArgumentError.new("No credentials for :#{key}")
|
||||
exit
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
11
lib/fog.rb
11
lib/fog.rb
|
@ -40,11 +40,14 @@ module Fog
|
|||
|
||||
def self.credentials(key = :default)
|
||||
@credentials ||= begin
|
||||
credentials = {}
|
||||
File.open(File.expand_path('~/.fog')) do |file|
|
||||
credentials = YAML.load(file.read)[key]
|
||||
path = File.expand_path('~/.fog')
|
||||
if File.exists?(path)
|
||||
File.open(path) do |file|
|
||||
YAML.load(file.read)[key]
|
||||
end
|
||||
else
|
||||
nil
|
||||
end
|
||||
credentials
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче