summaryrefslogtreecommitdiff
path: root/src/Propellor/Protocol.hs
diff options
context:
space:
mode:
authorJoey Hess2014-11-18 15:15:56 -0400
committerJoey Hess2014-11-18 15:15:56 -0400
commit9dfae00bd3949e4e23d4c24c7aa7375fdff4c9fb (patch)
treef672c2551448ff618c2e58be7e977b283cf92b28 /src/Propellor/Protocol.hs
parent781e35a333d1ca930f9d94c716104c90bf28970d (diff)
propellor spin
Diffstat (limited to 'src/Propellor/Protocol.hs')
-rw-r--r--src/Propellor/Protocol.hs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Propellor/Protocol.hs b/src/Propellor/Protocol.hs
index 6394fc71..bdea7d10 100644
--- a/src/Propellor/Protocol.hs
+++ b/src/Propellor/Protocol.hs
@@ -28,7 +28,7 @@ gitPushMarker :: String
gitPushMarker = "GITPUSH"
toMarked :: Marker -> String -> String
-toMarked marker = ++
+toMarked = (++)
fromMarked :: Marker -> Marked -> Maybe String
fromMarked marker s
@@ -47,11 +47,13 @@ getMarked :: Handle -> Marker -> IO (Maybe String)
getMarked h marker = go =<< catchMaybeIO (hGetLine h)
where
go Nothing = return Nothing
- go (Just l) = case fromMarked marker l of
- Nothing -> do
- putStrLn l
- getMarked h marker
- Just v -> return (Just v)
+ go (Just l) = do
+ hPutStrLn stderr $ show ("got ", l)
+ case fromMarked marker l of
+ Nothing -> do
+ putStrLn l
+ getMarked h marker
+ Just v -> return (Just v)
req :: Stage -> Marker -> (String -> IO ()) -> IO ()
req stage marker a = do