From 1e3a0e39cb6cdc86a6ba6b570c72c44931cf1c3b Mon Sep 17 00:00:00 2001 From: pacien Date: Sun, 5 Jan 2020 20:40:41 +0100 Subject: compiler: replace file filter with inclusino and exclusion glob lists GitHub: closes #16 --- compiler/src/Config.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'compiler/src/Config.hs') diff --git a/compiler/src/Config.hs b/compiler/src/Config.hs index 20bc3bb..53333a5 100644 --- a/compiler/src/Config.hs +++ b/compiler/src/Config.hs @@ -34,7 +34,8 @@ import Resource (Resolution(..)) data CompilerConfig = CompilerConfig { galleryName :: String - , ignoreFiles :: String + , includeFiles :: [String] + , excludeFiles :: [String] , tagsFromDirectories :: Int , thumbnailMaxResolution :: Resolution , pictureMaxResolution :: Maybe Resolution @@ -43,7 +44,8 @@ data CompilerConfig = CompilerConfig instance FromJSON CompilerConfig where parseJSON = withObject "CompilerConfig" $ \v -> CompilerConfig <$> v .:? "galleryName" .!= "Gallery" - <*> v .:? "ignoreFiles" .!= ".^" + <*> v .:? "includeFiles" .!= ["*"] + <*> v .:? "excludeFiles" .!= [] <*> v .:? "tagsFromDirectories" .!= 0 <*> v .:? "thumbnailMaxResolution" .!= (Resolution 400 400) <*> v .:? "pictureMaxResolution" -- cgit v1.2.3