Handle exception if not config file exists

This commit is contained in:
Brian Cain 2015-09-14 14:40:34 -07:00
parent bda732fc17
commit 4c1add6060

View file

@ -204,7 +204,12 @@ class Vmfloaty
end end
def read_config def read_config
conf = {}
begin
conf = YAML.load_file("#{Dir.home}/.vmfloaty.yml") conf = YAML.load_file("#{Dir.home}/.vmfloaty.yml")
rescue
STDERR.puts "There was no config file at #{Dir.home}/.vmfloaty.yml"
end
conf conf
end end
end end