propellor spin
This commit is contained in:
parent
c246a8ee74
commit
eb78bbae19
|
@ -147,7 +147,7 @@ spin host = do
|
||||||
]
|
]
|
||||||
, "else " ++ intercalate " && "
|
, "else " ++ intercalate " && "
|
||||||
[ "cd " ++ localdir
|
[ "cd " ++ localdir
|
||||||
--, "if ! test -x ./propellor; then make build; fi"
|
, "if ! test -x ./propellor; then make build; fi"
|
||||||
, "./propellor --boot " ++ host
|
, "./propellor --boot " ++ host
|
||||||
]
|
]
|
||||||
, "fi"
|
, "fi"
|
||||||
|
|
|
@ -10,13 +10,12 @@ import Propellor.Types
|
||||||
actionMessage :: ActionResult r => Desc -> IO r -> IO r
|
actionMessage :: ActionResult r => Desc -> IO r -> IO r
|
||||||
actionMessage desc a = do
|
actionMessage desc a = do
|
||||||
setTitle desc
|
setTitle desc
|
||||||
showdesc
|
|
||||||
putStrLn "starting"
|
|
||||||
hFlush stdout
|
hFlush stdout
|
||||||
|
|
||||||
r <- a
|
r <- a
|
||||||
|
|
||||||
let (msg, intensity, color) = getActionResult r
|
let (msg, intensity, color) = getActionResult r
|
||||||
|
putStr $ desc ++ " ... "
|
||||||
showdesc
|
showdesc
|
||||||
setSGR [SetColor Foreground intensity color]
|
setSGR [SetColor Foreground intensity color]
|
||||||
putStrLn msg
|
putStrLn msg
|
||||||
|
@ -24,8 +23,6 @@ actionMessage desc a = do
|
||||||
hFlush stdout
|
hFlush stdout
|
||||||
|
|
||||||
return r
|
return r
|
||||||
where
|
|
||||||
showdesc = putStr $ desc ++ " ... "
|
|
||||||
|
|
||||||
warningMessage :: String -> IO ()
|
warningMessage :: String -> IO ()
|
||||||
warningMessage s = do
|
warningMessage s = do
|
||||||
|
|
|
@ -30,8 +30,8 @@ class ActionResult a where
|
||||||
getActionResult :: a -> (String, ColorIntensity, Color)
|
getActionResult :: a -> (String, ColorIntensity, Color)
|
||||||
|
|
||||||
instance ActionResult Bool where
|
instance ActionResult Bool where
|
||||||
getActionResult False = ("ok", Vivid, Red)
|
getActionResult False = ("failed", Vivid, Red)
|
||||||
getActionResult True = ("failed", Vivid, Green)
|
getActionResult True = ("ok", Vivid, Green)
|
||||||
|
|
||||||
instance ActionResult Result where
|
instance ActionResult Result where
|
||||||
getActionResult NoChange = ("unchanged", Dull, Green)
|
getActionResult NoChange = ("unchanged", Dull, Green)
|
||||||
|
|
Loading…
Reference in New Issue