diff options
Diffstat (limited to 'compiler/src')
-rw-r--r-- | compiler/src/Input.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/src/Input.hs b/compiler/src/Input.hs index e0fc8ef..75d1ed3 100644 --- a/compiler/src/Input.hs +++ b/compiler/src/Input.hs | |||
@@ -80,8 +80,11 @@ emptySidecar = Sidecar | |||
80 | sidecarExt :: String | 80 | sidecarExt :: String |
81 | sidecarExt = "yaml" | 81 | sidecarExt = "yaml" |
82 | 82 | ||
83 | dirSidecar :: String | 83 | dirPropFile :: String |
84 | dirSidecar = "directory." ++ sidecarExt | 84 | dirPropFile = "_directory" |
85 | |||
86 | dirSidecar :: Path | ||
87 | dirSidecar = Path [dirPropFile] <.> sidecarExt | ||
85 | 88 | ||
86 | readSidecarFile :: FilePath -> IO Sidecar | 89 | readSidecarFile :: FilePath -> IO Sidecar |
87 | readSidecarFile filepath = | 90 | readSidecarFile filepath = |
@@ -111,7 +114,7 @@ readInputTree (AnchoredFSNode anchor root@Dir{}) = mkDirNode root | |||
111 | do | 114 | do |
112 | dirItems <- mapM mkInputNode items | 115 | dirItems <- mapM mkInputNode items |
113 | modTime <- getModificationTime $ localPath (anchor /> path) | 116 | modTime <- getModificationTime $ localPath (anchor /> path) |
114 | sidecar <- readSidecarFile $ localPath (anchor /> path </ dirSidecar) | 117 | sidecar <- readSidecarFile $ localPath (anchor /> path </> dirSidecar) |
115 | return $ InputDir path modTime sidecar (findThumbnail items) (catMaybes dirItems) | 118 | return $ InputDir path modTime sidecar (findThumbnail items) (catMaybes dirItems) |
116 | 119 | ||
117 | isSidecar :: FSNode -> Bool | 120 | isSidecar :: FSNode -> Bool |
@@ -125,7 +128,7 @@ readInputTree (AnchoredFSNode anchor root@Dir{}) = mkDirNode root | |||
125 | isThumbnail File{path} = | 128 | isThumbnail File{path} = |
126 | fileName path | 129 | fileName path |
127 | & fmap dropExtension | 130 | & fmap dropExtension |
128 | & (maybe False ("thumbnail" ==)) | 131 | & (maybe False (dirPropFile ==)) |
129 | 132 | ||
130 | findThumbnail :: [FSNode] -> Maybe Path | 133 | findThumbnail :: [FSNode] -> Maybe Path |
131 | findThumbnail = (fmap Files.path) . (find isThumbnail) | 134 | findThumbnail = (fmap Files.path) . (find isThumbnail) |