Skip to content

Commit

Permalink
[#45] Use UTF-8 encoding (allows to use hs-init on Windows)
Browse files Browse the repository at this point in the history
  • Loading branch information
chshersh committed Jan 18, 2018
1 parent c1c7a6e commit 2e31c80
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hs-init.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import System.Console.ANSI (Color (Blue, Green, Red, Yellow), ColorIntensity (Vi
SGR (Reset, SetColor, SetConsoleIntensity), setSGR)
import System.Directory (doesPathExist, getCurrentDirectory, setCurrentDirectory)
import System.FilePath ((</>))
import System.IO (hSetEncoding, stdout, utf8)
import System.Process (callCommand, readProcess, showCommandForUser)

import qualified Data.Text as T
Expand Down Expand Up @@ -83,7 +84,9 @@ endLine = "\n"
----------------------------------------------------------------------------

main :: IO ()
main = execParser prsr >>= runWithOptions
main = do
hSetEncoding stdout utf8
execParser prsr >>= runWithOptions

-- | Run 'hs-init' with cli options
runWithOptions :: InitOpts -> IO ()
Expand Down

0 comments on commit 2e31c80

Please sign in to comment.