From 49b4f4696b29862524792bcc610dd09aa93c187c Mon Sep 17 00:00:00 2001 From: pho Date: Sat, 15 Mar 2008 15:48:21 +0900 Subject: [PATCH] Bugfix darcs-hash:20080315064821-62b54-56988553ccaee16fc3a4179324dcf26b606f4250.gz --- Rakka/Storage/DefaultPage.hs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Rakka/Storage/DefaultPage.hs b/Rakka/Storage/DefaultPage.hs index c8efd4c..e6f51a5 100644 --- a/Rakka/Storage/DefaultPage.hs +++ b/Rakka/Storage/DefaultPage.hs @@ -56,13 +56,18 @@ getDefaultDirContents dir getDir' =<< getDataFileName "defaultPages" where getDir' :: FilePath -> IO (Set PageName) - getDir' dirPath - = getDirectoryContents (dirPath encodePageName dir) - >>= - return . S.fromList . map (m dirPath) . filter f + getDir' basePath + = do let childDirPath = basePath encodePageName dir + exists <- doesDirectoryExist childDirPath + if exists then + getDirectoryContents childDirPath + >>= + return . S.fromList . map (m basePath) . filter f + else + return S.empty m :: FilePath -> FilePath -> PageName - m dirPath = (dir ) . decodePageName . makeRelative dirPath . dropExtension + m basePath = (dir ) . decodePageName . makeRelative basePath . dropExtension f :: FilePath -> Bool f "." = False -- 2.40.0