Skip to content

Commit

Permalink
Merge pull request #41 from haskell-jp/issue22
Browse files Browse the repository at this point in the history
Fix #22: Disable -fdiagnostics-color=always on Windows
  • Loading branch information
igrep committed Oct 30, 2018
2 parents a949f22 + 44f13fa commit 9d47e20
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Education/MakeMistakesToLearnHaskell/Evaluator/RunHaskell.hs
Expand Up @@ -33,12 +33,17 @@ resolveInterpreter :: IO [String]
resolveInterpreter = do
stack <- Dir.findExecutable "stack"
case stack of
Just p -> return [p, "exec", executableName, "--", optionAlwaysColor]
_ -> maybe [] (: [optionAlwaysColor]) <$> Dir.findExecutable executableName
Just p -> return $ [p, "exec", executableName, "--"] ++ optionsAlwaysColor
_ -> maybe [] (: optionsAlwaysColor) <$> Dir.findExecutable executableName


optionAlwaysColor :: String
optionAlwaysColor = "--ghc-arg=-fdiagnostics-color=always"
optionsAlwaysColor :: [String]
#ifdef mingw32_HOST_OS
-- FIXME: Command Prompt can't handle -fdiagnostics-color=always properly.
optionsAlwaysColor = []
#else
optionsAlwaysColor = ["--ghc-arg=-fdiagnostics-color=always"]
#endif


executableName :: String
Expand Down

0 comments on commit 9d47e20

Please sign in to comment.