summaryrefslogtreecommitdiff
path: root/src/Propellor/Message.hs
diff options
context:
space:
mode:
authorJoey Hess2014-11-19 21:48:48 -0400
committerJoey Hess2014-11-19 21:48:48 -0400
commitd130e7e628568be9593474fbe5601239c6ce8a2e (patch)
treed2a87543685fa5b14a188ce9a6734a27d6ca660a /src/Propellor/Message.hs
parentd38037682584313fff39650bd8e8004c713be66b (diff)
propellor spin
Diffstat (limited to 'src/Propellor/Message.hs')
-rw-r--r--src/Propellor/Message.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Propellor/Message.hs b/src/Propellor/Message.hs
index a5d4d2ca..244913ea 100644
--- a/src/Propellor/Message.hs
+++ b/src/Propellor/Message.hs
@@ -15,16 +15,19 @@ import Control.Applicative
import Propellor.Types
import Utility.Monad
import Utility.Env
+import Utility.FileSystemEncoding
data MessageHandle
= ConsoleMessageHandle
| TextMessageHandle
mkMessageHandle :: IO MessageHandle
-mkMessageHandle = ifM (hIsTerminalDevice stdout <||> (isJust <$> getEnv "PROPELLOR_CONSOLE"))
- ( return ConsoleMessageHandle
- , return TextMessageHandle
- )
+mkMessageHandle = do
+ fileEncoding stdout
+ ifM (hIsTerminalDevice stdout <||> (isJust <$> getEnv "PROPELLOR_CONSOLE"))
+ ( return ConsoleMessageHandle
+ , return TextMessageHandle
+ )
forceConsole :: IO ()
forceConsole = void $ setEnv "PROPELLOR_CONSOLE" "1" True