From aa9aa832d216db71f363ad71a1ee13b5d8eaec5a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 18 Nov 2014 14:09:18 -0400 Subject: refactor --- src/Propellor/Protocol.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Propellor/Protocol.hs') 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 -- cgit v1.3-2-g0d8e