diff options
Diffstat (limited to 'compiler/src/Input.hs')
-rw-r--r-- | compiler/src/Input.hs | 7 |
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 | |||
79 | sidecarExt :: String | 80 | sidecarExt :: String |
80 | sidecarExt = "yaml" | 81 | sidecarExt = "yaml" |
81 | 82 | ||
83 | dirSidecar :: String | ||
84 | dirSidecar = "directory." ++ sidecarExt | ||
85 | |||
82 | readSidecarFile :: FilePath -> IO Sidecar | 86 | readSidecarFile :: FilePath -> IO Sidecar |
83 | readSidecarFile filepath = | 87 | readSidecarFile 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 |