aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/Compiler.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/Compiler.hs')
-rw-r--r--compiler/src/Compiler.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/src/Compiler.hs b/compiler/src/Compiler.hs
index 27598b7..fc40a76 100644
--- a/compiler/src/Compiler.hs
+++ b/compiler/src/Compiler.hs
@@ -102,8 +102,8 @@ galleryDirFilter config =
102 any (matchesFile (== indexFile) ||| matchesFile (== viewerMainFile)) items 102 any (matchesFile (== indexFile) ||| matchesFile (== viewerMainFile)) items
103 103
104 104
105compileGallery :: FilePath -> FilePath -> Bool -> IO () 105compileGallery :: FilePath -> FilePath -> Bool -> Bool -> IO ()
106compileGallery inputDirPath outputDirPath rebuildAll = 106compileGallery inputDirPath outputDirPath rebuildAll cleanOutput =
107 do 107 do
108 fullConfig <- readConfig inputGalleryConf 108 fullConfig <- readConfig inputGalleryConf
109 let config = compiler fullConfig 109 let config = compiler fullConfig
@@ -119,7 +119,11 @@ compileGallery inputDirPath outputDirPath rebuildAll =
119 let galleryBuilder = buildGalleryTree itemProc thumbnailProc (tagsFromDirectories config) 119 let galleryBuilder = buildGalleryTree itemProc thumbnailProc (tagsFromDirectories config)
120 resources <- galleryBuilder (galleryName config) inputTree 120 resources <- galleryBuilder (galleryName config) inputTree
121 121
122 galleryCleanupResourceDir resources outputDirPath 122 if cleanOutput then
123 galleryCleanupResourceDir resources outputDirPath
124 else
125 return ()
126
123 writeJSON outputIndex resources 127 writeJSON outputIndex resources
124 writeJSON outputViewerConf $ viewer fullConfig 128 writeJSON outputViewerConf $ viewer fullConfig
125 129