aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/Compiler.hs
diff options
context:
space:
mode:
authorpacien2020-02-22 14:53:03 +0100
committerpacien2020-02-23 22:49:16 +0100
commite42f4e864bac21ed3b19d1869df2cdd4f8c3433c (patch)
tree1d9a22c75da88581f904c91d6492c746932c6927 /compiler/src/Compiler.hs
parentce0b7ec230703d239b3d77e09352c0b1d515d8f5 (diff)
downloadldgallery-e42f4e864bac21ed3b19d1869df2cdd4f8c3433c.tar.gz
compiler: flatten gallery config
GitHub: closes #129
Diffstat (limited to 'compiler/src/Compiler.hs')
-rw-r--r--compiler/src/Compiler.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/src/Compiler.hs b/compiler/src/Compiler.hs
index bb0ee97..73ac8a4 100644
--- a/compiler/src/Compiler.hs
+++ b/compiler/src/Compiler.hs
@@ -70,7 +70,7 @@ writeJSON outputPath object =
70 ensureParentDir JSON.encodeFile outputPath object 70 ensureParentDir JSON.encodeFile outputPath object
71 71
72 72
73galleryDirFilter :: CompilerConfig -> [FilePath] -> FSNode -> Bool 73galleryDirFilter :: GalleryConfig -> [FilePath] -> FSNode -> Bool
74galleryDirFilter config excludedCanonicalDirs = 74galleryDirFilter config excludedCanonicalDirs =
75 (not . isHidden) 75 (not . isHidden)
76 &&& (not . isExcludedDir) 76 &&& (not . isExcludedDir)
@@ -102,8 +102,7 @@ galleryDirFilter config excludedCanonicalDirs =
102compileGallery :: FilePath -> FilePath -> FilePath -> [FilePath] -> Bool -> Bool -> IO () 102compileGallery :: FilePath -> FilePath -> FilePath -> [FilePath] -> Bool -> Bool -> IO ()
103compileGallery configPath inputDirPath outputDirPath excludedDirs rebuildAll cleanOutput = 103compileGallery configPath inputDirPath outputDirPath excludedDirs rebuildAll cleanOutput =
104 do 104 do
105 fullConfig <- readConfig $ inputGalleryConf configPath 105 config <- readConfig $ inputGalleryConf configPath
106 let config = compiler fullConfig
107 106
108 inputDir <- readDirectory inputDirPath 107 inputDir <- readDirectory inputDirPath
109 excludedCanonicalDirs <- mapM canonicalizePath excludedDirs 108 excludedCanonicalDirs <- mapM canonicalizePath excludedDirs
@@ -119,7 +118,7 @@ compileGallery configPath inputDirPath outputDirPath excludedDirs rebuildAll cle
119 118
120 when cleanOutput $ galleryCleanupResourceDir resources outputDirPath 119 when cleanOutput $ galleryCleanupResourceDir resources outputDirPath
121 writeJSON outputIndex resources 120 writeJSON outputIndex resources
122 writeJSON outputViewerConf $ viewer fullConfig 121 writeJSON outputViewerConf $ viewerConfig config
123 122
124 where 123 where
125 inputGalleryConf :: FilePath -> FilePath 124 inputGalleryConf :: FilePath -> FilePath