cache_store: create HOMEBREW_CACHE when needed.

Fixes #4366.
This commit is contained in:
Mike McQuaid 2018-06-21 13:59:07 +01:00
parent 41e27928c4
commit 512073ad38

View File

@ -62,7 +62,10 @@ class CacheStoreDatabase
# @return [DBM] db
def db
# DBM::WRCREAT: Creates the database if it does not already exist
@db ||= DBM.open(dbm_file_path, DATABASE_MODE, DBM::WRCREAT)
@db ||= begin
HOMEBREW_CACHE.mkpath
DBM.open(dbm_file_path, DATABASE_MODE, DBM::WRCREAT)
end
end
# Creates a CacheStoreDatabase