summaryrefslogtreecommitdiff
path: root/src/Propellor/Protocol.hs
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2014-11-18 21:18:26 -0400
committerJoey Hess <joey@kitenet.net>2014-11-18 21:18:26 -0400
commitaa3f31940b544e528a5eb3d2e9825a703a8b5013 (patch)
tree0a14bfdf3be969f6029fb54f0c95e2e06ae7d40d /src/Propellor/Protocol.hs
parenta19f01a508747fb1f04849616422d1530e8ec2da (diff)
parentb964b4836321832ad8d3be7268fd3af9ed8f5ea8 (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Protocol.hs')
-rw-r--r--src/Propellor/Protocol.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Propellor/Protocol.hs b/src/Propellor/Protocol.hs
index 99afb31f..f8b706cc 100644
--- a/src/Propellor/Protocol.hs
+++ b/src/Propellor/Protocol.hs
@@ -1,7 +1,7 @@
-- | This is a simple line-based protocol used for communication between
-- a local and remote propellor. It's sent over a ssh channel, and lines of
-- the protocol can be interspersed with other, non-protocol lines
--- that should be ignored.
+-- that should be passed through to be displayed.
module Propellor.Protocol where
@@ -9,7 +9,7 @@ import Data.List
import Propellor
-data Stage = Ready | NeedGitClone | NeedRepoUrl | NeedPrivData | NeedGitPush
+data Stage = NeedGitClone | NeedRepoUrl | NeedPrivData | NeedGitPush
deriving (Read, Show, Eq)
type Marker = String
@@ -48,7 +48,10 @@ getMarked h marker = go =<< catchMaybeIO (hGetLine h)
where
go Nothing = return Nothing
go (Just l) = case fromMarked marker l of
- Nothing -> getMarked h marker
+ Nothing -> do
+ unless (null l) $
+ hPutStrLn stderr l
+ getMarked h marker
Just v -> return (Just v)
req :: Stage -> Marker -> (String -> IO ()) -> IO ()