propellor spin

This commit is contained in:
Joey Hess 2014-11-18 15:15:56 -04:00
parent 781e35a333
commit 9dfae00bd3
Failed to extract signature
1 changed files with 8 additions and 6 deletions

View File

@ -28,7 +28,7 @@ gitPushMarker :: String
gitPushMarker = "GITPUSH" gitPushMarker = "GITPUSH"
toMarked :: Marker -> String -> String toMarked :: Marker -> String -> String
toMarked marker = ++ toMarked = (++)
fromMarked :: Marker -> Marked -> Maybe String fromMarked :: Marker -> Marked -> Maybe String
fromMarked marker s fromMarked marker s
@ -47,11 +47,13 @@ getMarked :: Handle -> Marker -> IO (Maybe String)
getMarked h marker = go =<< catchMaybeIO (hGetLine h) getMarked h marker = go =<< catchMaybeIO (hGetLine h)
where where
go Nothing = return Nothing go Nothing = return Nothing
go (Just l) = case fromMarked marker l of go (Just l) = do
Nothing -> do hPutStrLn stderr $ show ("got ", l)
putStrLn l case fromMarked marker l of
getMarked h marker Nothing -> do
Just v -> return (Just v) putStrLn l
getMarked h marker
Just v -> return (Just v)
req :: Stage -> Marker -> (String -> IO ()) -> IO () req :: Stage -> Marker -> (String -> IO ()) -> IO ()
req stage marker a = do req stage marker a = do