mirror of
https://github.com/reanimate/reanimate.git
synced 2026-09-14 09:32:22 +00:00
Improve error messages in web-viewer.
This commit is contained in:
parent
85e64d863d
commit
5a2b679619
1 changed files with 2 additions and 1 deletions
|
|
@ -49,7 +49,7 @@ generateResponse c conn msg = do
|
||||||
withTempFile ".hs" $ \tmpSource ->
|
withTempFile ".hs" $ \tmpSource ->
|
||||||
withTempDir $ \tmpDir -> do
|
withTempDir $ \tmpDir -> do
|
||||||
writeFile tmpSource $ unlines
|
writeFile tmpSource $ unlines
|
||||||
["{-# LANGUAGE Arrows, OverloadedStrings #-}"
|
["{-# LANGUAGE Arrows, OverloadedStrings, CPP #-}"
|
||||||
,"module Main where"
|
,"module Main where"
|
||||||
,"import Reanimate.Arrow"
|
,"import Reanimate.Arrow"
|
||||||
,"import Reanimate.Combinators"
|
,"import Reanimate.Combinators"
|
||||||
|
|
@ -68,6 +68,7 @@ generateResponse c conn msg = do
|
||||||
," width_, x1_, x2_, x_, y1_, y2_, y_)"
|
," width_, x1_, x2_, x_, y1_, y2_, y_)"
|
||||||
,"import qualified Lucid.Svg as Lucid"
|
,"import qualified Lucid.Svg as Lucid"
|
||||||
,"main = renderSvgs animation " ++ show tmpDir
|
,"main = renderSvgs animation " ++ show tmpDir
|
||||||
|
,"#line 1 \"animation.hs\""
|
||||||
] ++ T.unpack msg
|
] ++ T.unpack msg
|
||||||
putStrLn $ "Compiling program:\n" ++ T.unpack msg
|
putStrLn $ "Compiling program:\n" ++ T.unpack msg
|
||||||
ret <- runCmd_ "stack" ["ghc", "--", "-rtsopts", "--make", "-threaded", "-O2", tmpSource, "-o", tmpExecutable]
|
ret <- runCmd_ "stack" ["ghc", "--", "-rtsopts", "--make", "-threaded", "-O2", tmpSource, "-o", tmpExecutable]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue