Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

Fix build with non-utf8 locale #205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion elm-reactor.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Executable elm-reactor
filepath,
fsnotify >= 0.2,
mtl,
process,
process-extras,
snap-core,
snap-server,
template-haskell,
Expand Down
8 changes: 5 additions & 3 deletions src/backend/StaticFiles/Build.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ module StaticFiles.Build
where

import qualified Data.ByteString as BS
import Data.ByteString.Char8 (unpack)
import System.Directory (removeFile)
import System.Exit (ExitCode(..), exitFailure)
import System.FilePath ((<.>), takeBaseName)
import System.IO (hPutStrLn, stderr)
import System.Process (readProcessWithExitCode)
import System.Process.ByteString (readProcessWithExitCode)



Expand All @@ -34,12 +35,13 @@ elmMake source target =
readProcessWithExitCode
"elm-make"
[ "--yes", source, "--output=" ++ target ]
""
BS.empty

case exitCode of
ExitSuccess ->
return ()

ExitFailure _ ->
do hPutStrLn stderr (unlines ["Failed to build " ++ source, "", out, err])
do hPutStrLn stderr (unlines ["Failed to build " ++ source, "",
unpack out, unpack err])
exitFailure