propellor spin
This commit is contained in:
parent
614d497895
commit
e563b8cdf6
|
@ -9,6 +9,7 @@ import Data.Maybe
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
|
|
||||||
import Types
|
import Types
|
||||||
|
import Property
|
||||||
import Utility.Monad
|
import Utility.Monad
|
||||||
import Utility.PartialPrelude
|
import Utility.PartialPrelude
|
||||||
import Utility.Exception
|
import Utility.Exception
|
||||||
|
@ -29,8 +30,7 @@ withPrivData :: PrivDataField -> (String -> IO Result) -> IO Result
|
||||||
withPrivData field a = maybe missing a =<< getPrivData field
|
withPrivData field a = maybe missing a =<< getPrivData field
|
||||||
where
|
where
|
||||||
missing = do
|
missing = do
|
||||||
hPutStrLn stderr $ "** Missing privdata " ++ show field
|
warningMessage $ "Missing privdata " ++ show field
|
||||||
hFlush stderr
|
|
||||||
return FailedChange
|
return FailedChange
|
||||||
|
|
||||||
getPrivData :: PrivDataField -> IO (Maybe String)
|
getPrivData :: PrivDataField -> IO (Maybe String)
|
||||||
|
|
|
@ -116,3 +116,10 @@ ensureProperties' ps = ensure ps NoChange
|
||||||
putStrLn "done"
|
putStrLn "done"
|
||||||
setSGR []
|
setSGR []
|
||||||
ensure ls (combineResult r rs)
|
ensure ls (combineResult r rs)
|
||||||
|
|
||||||
|
warningMessage :: String -> IO ()
|
||||||
|
warningMessage s = do
|
||||||
|
setSGR [SetColor Foreground Vivid Red]
|
||||||
|
putStrLn $ "** warning: " ++ s
|
||||||
|
setSGR []
|
||||||
|
hFlush stdout
|
||||||
|
|
Loading…
Reference in New Issue