aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/Resource.hs
diff options
context:
space:
mode:
authorpacien2019-12-30 01:40:55 +0100
committerpacien2019-12-30 01:40:55 +0100
commit8a75458290002c765a0fa673912c162020de2bd1 (patch)
treedd8a6302b6bf786821b1d92f16af10375b9b16a7 /compiler/src/Resource.hs
parentab84d0503e39f0a3acb6f8f5e6706a377aaeaf33 (diff)
downloadldgallery-8a75458290002c765a0fa673912c162020de2bd1.tar.gz
compiler: refactor path handling
Diffstat (limited to 'compiler/src/Resource.hs')
-rw-r--r--compiler/src/Resource.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/src/Resource.hs b/compiler/src/Resource.hs
index 9d60185..afc8203 100644
--- a/compiler/src/Resource.hs
+++ b/compiler/src/Resource.hs
@@ -100,7 +100,7 @@ outputDiff resources ref =
100 resPaths resList = map resPath resList ++ thumbnailPaths resList 100 resPaths resList = map resPath resList ++ thumbnailPaths resList
101 101
102 thumbnailPaths :: [ResourceTree] -> [Path] 102 thumbnailPaths :: [ResourceTree] -> [Path]
103 thumbnailPaths = (concatMap subsequences) . (mapMaybe thumbnailPath) 103 thumbnailPaths = (concatMap subPaths) . (mapMaybe thumbnailPath)
104 104
105 fsPaths :: FSNode -> [Path] 105 fsPaths :: FSNode -> [Path]
106 fsPaths = map nodePath . tail . flattenDir 106 fsPaths = map nodePath . tail . flattenDir
@@ -109,6 +109,6 @@ cleanupResourceDir :: ResourceTree -> FileName -> IO ()
109cleanupResourceDir resourceTree outputDir = 109cleanupResourceDir resourceTree outputDir =
110 readDirectory outputDir 110 readDirectory outputDir
111 >>= return . outputDiff resourceTree . root 111 >>= return . outputDiff resourceTree . root
112 >>= return . sortBy (flip $ comparing length) -- nested files before dirs 112 >>= return . sortBy (flip $ comparing pathLength) -- nested files before dirs
113 >>= return . map (localPath . (/>) outputDir) 113 >>= return . map (localPath . (/>) outputDir)
114 >>= mapM_ remove 114 >>= mapM_ remove