forked from blanu/juicer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsqueeze.hs
More file actions
28 lines (25 loc) · 822 Bytes
/
squeeze.hs
File metadata and controls
28 lines (25 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import System.Environment (getArgs)
import Data.List
import Data.List.Split
import Juicer.Freeze
import Juicer.Puree
import Juicer.Blend
main :: IO ()
main = do
args <- getArgs
case args of
(requestname:archivename:diffname:[]) -> do
maybeRequest <- requestthaw requestname
maybeArchive <- thaw archivename
case (maybeRequest, maybeArchive) of
(Nothing, _) -> return ()
(_, Nothing) -> return ()
(Just request, Just archive) -> squeeze request archive diffname
otherwise -> putStrLn "blend [request] [archive] [diff]"
squeeze :: Request -> Feed -> String -> IO()
squeeze request archive diffname = do
putStrLn $ show request
putStrLn $ show archive
let d = diff archive request
freezediff d diffname
putStrLn $ show d