Merge branch 'joeyconfig'
This commit is contained in:
commit
16031a7c26
|
@ -41,6 +41,11 @@ fromMarked marker s
|
|||
|
||||
sendMarked :: Handle -> Marker -> String -> IO ()
|
||||
sendMarked h marker s = do
|
||||
debug ["sent marked", marker]
|
||||
sendMarked' h marker s
|
||||
|
||||
sendMarked' :: Handle -> Marker -> String -> IO ()
|
||||
sendMarked' h marker s = do
|
||||
-- Prefix string with newline because sometimes a
|
||||
-- incomplete line has been output, and the marker needs to
|
||||
-- come at the start of a line.
|
||||
|
@ -56,9 +61,12 @@ getMarked h marker = go =<< catchMaybeIO (hGetLine h)
|
|||
unless (null l) $
|
||||
hPutStrLn stderr l
|
||||
getMarked h marker
|
||||
Just v -> return (Just v)
|
||||
Just v -> do
|
||||
debug ["received marked", marker]
|
||||
return (Just v)
|
||||
|
||||
req :: Stage -> Marker -> (String -> IO ()) -> IO ()
|
||||
req stage marker a = do
|
||||
sendMarked stdout statusMarker (show stage)
|
||||
debug ["requested marked", marker]
|
||||
sendMarked' stdout statusMarker (show stage)
|
||||
maybe noop a =<< getMarked stdin marker
|
||||
|
|
Loading…
Reference in New Issue