propellor spin
This commit is contained in:
parent
3aff991553
commit
dd08ae61db
|
@ -6,3 +6,4 @@ privdata/keyring.gpg~
|
||||||
Setup
|
Setup
|
||||||
Setup.hi
|
Setup.hi
|
||||||
Setup.o
|
Setup.o
|
||||||
|
docker
|
||||||
|
|
|
@ -15,21 +15,25 @@ actionMessage desc a = do
|
||||||
|
|
||||||
r <- a
|
r <- a
|
||||||
|
|
||||||
|
setTitle "propellor: running"
|
||||||
let (msg, intensity, color) = getActionResult r
|
let (msg, intensity, color) = getActionResult r
|
||||||
putStr $ desc ++ " ... "
|
putStr $ desc ++ " ... "
|
||||||
setSGR [SetColor Foreground intensity color]
|
colorLine intensity color msg
|
||||||
putStrLn msg
|
|
||||||
setSGR []
|
|
||||||
setTitle "propellor: running"
|
|
||||||
hFlush stdout
|
hFlush stdout
|
||||||
|
|
||||||
return r
|
return r
|
||||||
|
|
||||||
warningMessage :: String -> IO ()
|
warningMessage :: String -> IO ()
|
||||||
warningMessage s = do
|
warningMessage s = colorLine Vivid Red $ "** warning: " ++ s
|
||||||
setSGR [SetColor Foreground Vivid Red]
|
|
||||||
putStrLn $ "** warning: " ++ s
|
colorLine :: ColorIntensity -> Color -> String -> IO ()
|
||||||
|
colorLine intensity color msg = do
|
||||||
|
setSGR [SetColor Foreground intensity color]
|
||||||
|
putStr msg
|
||||||
setSGR []
|
setSGR []
|
||||||
|
-- Note this comes after the color is reset, so that
|
||||||
|
-- the color set and reset happen in the same line.
|
||||||
|
putStrLn ""
|
||||||
hFlush stdout
|
hFlush stdout
|
||||||
|
|
||||||
errorMessage :: String -> IO a
|
errorMessage :: String -> IO a
|
||||||
|
|
Loading…
Reference in New Issue