From 7674711070df6c445e72e7899ae2ec3836aeb6f6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 12 Dec 2012 13:05:50 -0400 Subject: make parent directory --- Annex/Content/Direct.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs index 99b54f7e0..265195b87 100644 --- a/Annex/Content/Direct.hs +++ b/Annex/Content/Direct.hs @@ -109,8 +109,10 @@ compareCache file old = do {- Stores a cache of attributes for a file that is associated with a key. -} updateCache :: Key -> FilePath -> Annex () -updateCache key file = withCacheFile key $ \cachefile -> - maybe noop (writeFile cachefile . showCache) =<< genCache file +updateCache key file = do + withCacheFile key $ \cachefile -> do + createDirectoryIfMissing True (parentDir cachefile) + maybe noop (writeFile cachefile . showCache) =<< genCache file {- Removes a cache. -} removeCache :: Key -> Annex () -- cgit v1.2.3