Fixed inspec from crashing on startup when it can't create the cache directory.

Signed-off-by: Ryan Davis <zenspider@chef.io>
This commit is contained in:
Ryan Davis 2019-10-23 16:35:11 -07:00
parent aebcd3c119
commit c9a3c927f9

View file

@ -19,6 +19,8 @@ module Inspec
def initialize(path = nil)
@path = path || File.join(Inspec.config_dir, "cache")
FileUtils.mkdir_p(@path) unless File.directory?(@path)
rescue Errno::EACCES
# ignore
end
def prefered_entry_for(key)