diff options
Diffstat (limited to 'compiler/src/Compiler.hs')
-rw-r--r-- | compiler/src/Compiler.hs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/compiler/src/Compiler.hs b/compiler/src/Compiler.hs index bfefa63..bb0ee97 100644 --- a/compiler/src/Compiler.hs +++ b/compiler/src/Compiler.hs | |||
@@ -47,8 +47,8 @@ import Processors | |||
47 | , skipCached, withCached ) | 47 | , skipCached, withCached ) |
48 | 48 | ||
49 | 49 | ||
50 | galleryConf :: String | 50 | defaultGalleryConf :: String |
51 | galleryConf = "gallery.yaml" | 51 | defaultGalleryConf = "gallery.yaml" |
52 | 52 | ||
53 | indexFile :: String | 53 | indexFile :: String |
54 | indexFile = "index.json" | 54 | indexFile = "index.json" |
@@ -74,7 +74,6 @@ galleryDirFilter :: CompilerConfig -> [FilePath] -> FSNode -> Bool | |||
74 | galleryDirFilter config excludedCanonicalDirs = | 74 | galleryDirFilter config excludedCanonicalDirs = |
75 | (not . isHidden) | 75 | (not . isHidden) |
76 | &&& (not . isExcludedDir) | 76 | &&& (not . isExcludedDir) |
77 | &&& (not . matchesFile (== galleryConf)) | ||
78 | &&& ((matchesDir $ anyPattern $ includedDirectories config) ||| | 77 | &&& ((matchesDir $ anyPattern $ includedDirectories config) ||| |
79 | (matchesFile $ anyPattern $ includedFiles config)) | 78 | (matchesFile $ anyPattern $ includedFiles config)) |
80 | &&& (not . ((matchesDir $ anyPattern $ excludedDirectories config) ||| | 79 | &&& (not . ((matchesDir $ anyPattern $ excludedDirectories config) ||| |
@@ -100,10 +99,10 @@ galleryDirFilter config excludedCanonicalDirs = | |||
100 | isExcludedDir File{} = False | 99 | isExcludedDir File{} = False |
101 | 100 | ||
102 | 101 | ||
103 | compileGallery :: FilePath -> FilePath -> [FilePath] -> Bool -> Bool -> IO () | 102 | compileGallery :: FilePath -> FilePath -> FilePath -> [FilePath] -> Bool -> Bool -> IO () |
104 | compileGallery inputDirPath outputDirPath excludedDirs rebuildAll cleanOutput = | 103 | compileGallery configPath inputDirPath outputDirPath excludedDirs rebuildAll cleanOutput = |
105 | do | 104 | do |
106 | fullConfig <- readConfig inputGalleryConf | 105 | fullConfig <- readConfig $ inputGalleryConf configPath |
107 | let config = compiler fullConfig | 106 | let config = compiler fullConfig |
108 | 107 | ||
109 | inputDir <- readDirectory inputDirPath | 108 | inputDir <- readDirectory inputDirPath |
@@ -123,7 +122,10 @@ compileGallery inputDirPath outputDirPath excludedDirs rebuildAll cleanOutput = | |||
123 | writeJSON outputViewerConf $ viewer fullConfig | 122 | writeJSON outputViewerConf $ viewer fullConfig |
124 | 123 | ||
125 | where | 124 | where |
126 | inputGalleryConf = inputDirPath </> galleryConf | 125 | inputGalleryConf :: FilePath -> FilePath |
126 | inputGalleryConf "" = inputDirPath </> defaultGalleryConf | ||
127 | inputGalleryConf file = file | ||
128 | |||
127 | outputIndex = outputDirPath </> indexFile | 129 | outputIndex = outputDirPath </> indexFile |
128 | outputViewerConf = outputDirPath </> viewerConfFile | 130 | outputViewerConf = outputDirPath </> viewerConfFile |
129 | 131 | ||