summaryrefslogtreecommitdiff
path: root/src/Propellor/Protocol.hs
diff options
context:
space:
mode:
authorJoey Hess2014-11-18 14:09:18 -0400
committerJoey Hess2014-11-18 14:12:07 -0400
commitaa9aa832d216db71f363ad71a1ee13b5d8eaec5a (patch)
tree62844217d7e72898c545286b134e69446b7815ce /src/Propellor/Protocol.hs
parenta0ea904ecb43e4fef4ea13d68d7dd41ebbdf5b54 (diff)
refactor
Diffstat (limited to 'src/Propellor/Protocol.hs')
-rw-r--r--src/Propellor/Protocol.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Propellor/Protocol.hs b/src/Propellor/Protocol.hs
index 4dc7e6bb..164f6db6 100644
--- a/src/Propellor/Protocol.hs
+++ b/src/Propellor/Protocol.hs
@@ -9,7 +9,7 @@ import Data.List
import Propellor
-data BootStrapStatus = Ready | NeedGitClone | RepoUrl
+data Stage = Ready | NeedGitClone | NeedRepoUrl | NeedPrivData
deriving (Read, Show, Eq)
type Marker = String
@@ -49,3 +49,8 @@ getMarked h marker = go =<< catchMaybeIO (hGetLine h)
putStrLn l
getMarked h marker
Just v -> return (Just v)
+
+req :: Stage -> Marker -> (String -> IO ()) -> IO ()
+req stage marker a = do
+ sendMarked stdout statusMarker (show stage)
+ maybe noop a =<< getMarked stdin marker