aboutsummaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/src/Lib.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/src/Lib.hs b/compiler/src/Lib.hs
index abdbeb7..2068b4a 100644
--- a/compiler/src/Lib.hs
+++ b/compiler/src/Lib.hs
@@ -28,7 +28,9 @@ import GHC.Generics (Generic)
28import Data.Function ((&)) 28import Data.Function ((&))
29import System.Directory (createDirectoryIfMissing) 29import System.Directory (createDirectoryIfMissing)
30import System.FilePath (dropFileName, (</>)) 30import System.FilePath (dropFileName, (</>))
31import Data.Aeson (Object, ToJSON, FromJSON, encodeFile) 31
32import Data.Aeson (ToJSON, FromJSON)
33import qualified Data.Aeson as JSON
32 34
33import Files (FileName, readDirectory) 35import Files (FileName, readDirectory)
34import Input (decodeYamlFile, readInputTree) 36import Input (decodeYamlFile, readInputTree)
@@ -42,7 +44,7 @@ data CompilerConfig = CompilerConfig
42 44
43data GalleryConfig = GalleryConfig 45data GalleryConfig = GalleryConfig
44 { compiler :: CompilerConfig 46 { compiler :: CompilerConfig
45 , viewer :: Data.Aeson.Object 47 , viewer :: JSON.Object
46 } deriving (Generic, FromJSON, Show) 48 } deriving (Generic, FromJSON, Show)
47 49
48readConfig :: FileName -> IO GalleryConfig 50readConfig :: FileName -> IO GalleryConfig
@@ -92,7 +94,7 @@ process inputDirPath outputDirPath =
92 writeJSON :: ToJSON a => FileName -> a -> IO () 94 writeJSON :: ToJSON a => FileName -> a -> IO ()
93 writeJSON path obj = 95 writeJSON path obj =
94 createDirectoryIfMissing True (dropFileName path) 96 createDirectoryIfMissing True (dropFileName path)
95 >> encodeFile path obj 97 >> JSON.encodeFile path obj
96 98
97 99
98testRun :: IO () 100testRun :: IO ()