aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/Input.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/Input.hs')
-rw-r--r--compiler/src/Input.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/src/Input.hs b/compiler/src/Input.hs
index cb837e3..e0fc8ef 100644
--- a/compiler/src/Input.hs
+++ b/compiler/src/Input.hs
@@ -58,6 +58,7 @@ data InputTree =
58 | InputDir 58 | InputDir
59 { path :: Path 59 { path :: Path
60 , modTime :: UTCTime 60 , modTime :: UTCTime
61 , sidecar :: Sidecar
61 , dirThumbnailPath :: Maybe Path 62 , dirThumbnailPath :: Maybe Path
62 , items :: [InputTree] } 63 , items :: [InputTree] }
63 deriving Show 64 deriving Show
@@ -79,6 +80,9 @@ emptySidecar = Sidecar
79sidecarExt :: String 80sidecarExt :: String
80sidecarExt = "yaml" 81sidecarExt = "yaml"
81 82
83dirSidecar :: String
84dirSidecar = "directory." ++ sidecarExt
85
82readSidecarFile :: FilePath -> IO Sidecar 86readSidecarFile :: FilePath -> IO Sidecar
83readSidecarFile filepath = 87readSidecarFile filepath =
84 doesFileExist filepath 88 doesFileExist filepath
@@ -107,7 +111,8 @@ readInputTree (AnchoredFSNode anchor root@Dir{}) = mkDirNode root
107 do 111 do
108 dirItems <- mapM mkInputNode items 112 dirItems <- mapM mkInputNode items
109 modTime <- getModificationTime $ localPath (anchor /> path) 113 modTime <- getModificationTime $ localPath (anchor /> path)
110 return $ InputDir path modTime (findThumbnail items) (catMaybes dirItems) 114 sidecar <- readSidecarFile $ localPath (anchor /> path </ dirSidecar)
115 return $ InputDir path modTime sidecar (findThumbnail items) (catMaybes dirItems)
111 116
112 isSidecar :: FSNode -> Bool 117 isSidecar :: FSNode -> Bool
113 isSidecar Dir{} = False 118 isSidecar Dir{} = False