Commit de6c6ff5 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Merge pull request #1431 from nh2/flush-stdout

Improve stdout flushing
parents 1f890f8f e04b9d0e
......@@ -118,6 +118,7 @@ import qualified Paths_cabal_install (version)
import System.Environment (getArgs, getProgName)
import System.Exit (exitFailure)
import System.FilePath (splitExtension, takeExtension)
import System.IO (BufferMode(LineBuffering), hSetBuffering, stdout)
import System.Directory (doesFileExist)
import Data.List (intercalate)
import Data.Monoid (Monoid(..))
......@@ -126,7 +127,11 @@ import Control.Monad (when, unless)
-- | Entry point
main :: IO ()
main = getArgs >>= mainWorker
main = do
-- Enable line buffering so that we can get fast feedback even when piped.
-- This is especially important for CI and build systems.
hSetBuffering stdout LineBuffering
getArgs >>= mainWorker
mainWorker :: [String] -> IO ()
mainWorker args = topHandler $
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment