aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/Processors.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/Processors.hs')
-rw-r--r--compiler/src/Processors.hs12
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/src/Processors.hs b/compiler/src/Processors.hs
index aaa178f..c097db7 100644
--- a/compiler/src/Processors.hs
+++ b/compiler/src/Processors.hs
@@ -36,6 +36,9 @@ import Control.Exception (throwIO)
36import Data.Function ((&)) 36import Data.Function ((&))
37import Data.Ratio ((%)) 37import Data.Ratio ((%))
38 38
39import GHC.Generics (Generic)
40import Data.Aeson (FromJSON)
41
39import System.Directory hiding (copyFile) 42import System.Directory hiding (copyFile)
40import qualified System.Directory 43import qualified System.Directory
41import System.FilePath 44import System.FilePath
@@ -64,7 +67,7 @@ formatFromExt _ = Other
64 67
65data Resolution = Resolution 68data Resolution = Resolution
66 { width :: Int 69 { width :: Int
67 , height :: Int } deriving Show 70 , height :: Int } deriving (Show, Generic, FromJSON)
68 71
69type FileProcessor = 72type FileProcessor =
70 FileName -- ^ Input path 73 FileName -- ^ Input path
@@ -144,13 +147,6 @@ withCached processor inputPath outputPath =
144 update = processor inputPath outputPath 147 update = processor inputPath outputPath
145 skip = putStrLn $ "Skipping:\t" ++ outputPath 148 skip = putStrLn $ "Skipping:\t" ++ outputPath
146 149
147 isOutdated :: FilePath -> FilePath -> IO Bool
148 isOutdated ref target =
149 do
150 refTime <- getModificationTime ref
151 targetTime <- getModificationTime target
152 return (targetTime < refTime)
153
154 150
155type DirFileProcessor = 151type DirFileProcessor =
156 FileName -- ^ Input base path 152 FileName -- ^ Input base path