Merge pull request #4369 from MikeMcQuaid/cache_store_mkpath

cache_store: create HOMEBREW_CACHE when needed.
This commit is contained in:
Mike McQuaid 2018-06-21 14:56:29 +01:00 committed by GitHub
commit b87fc8c53a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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