summaryrefslogtreecommitdiff
path: root/src/Tex.hs
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-02-03 18:23:10 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2016-02-03 18:23:10 +0100
commit5c4377102f442208d844a3d42aa23a0d074b7257 (patch)
treef2e6441d5858154a82c63f6daf0febf00345a3b0 /src/Tex.hs
parent9d3ff4605d30b434cdc0f302bb565606f1bcf722 (diff)
downloaddirty-haskell.org-5c4377102f442208d844a3d42aa23a0d074b7257.tar
dirty-haskell.org-5c4377102f442208d844a3d42aa23a0d074b7257.tar.gz
dirty-haskell.org-5c4377102f442208d844a3d42aa23a0d074b7257.tar.bz2
dirty-haskell.org-5c4377102f442208d844a3d42aa23a0d074b7257.tar.xz
dirty-haskell.org-5c4377102f442208d844a3d42aa23a0d074b7257.zip
Fixed tex \end fuckup
Diffstat (limited to 'src/Tex.hs')
-rw-r--r--src/Tex.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Tex.hs b/src/Tex.hs
index a247218..5d347b9 100644
--- a/src/Tex.hs
+++ b/src/Tex.hs
@@ -2,10 +2,10 @@ module Tex
2 ( compileTex 2 ( compileTex
3 ) where 3 ) where
4 4
5import System.IO (stdout, stderr, hPutStrLn, writeFile, readFile) 5import System.IO (stdout, stderr, hPutStrLn, writeFile, readFile, hClose)
6import System.IO.Temp (withSystemTempDirectory) 6import System.IO.Temp (withSystemTempDirectory, openTempFile)
7import System.Process (callProcess, readProcessWithExitCode) 7import System.Process (callProcess, readProcessWithExitCode)
8import System.Directory (copyFile, getCurrentDirectory, setCurrentDirectory) 8import System.Directory (copyFile, getCurrentDirectory, setCurrentDirectory, getTemporaryDirectory)
9import System.FilePath (takeFileName, FilePath(..), (</>)) 9import System.FilePath (takeFileName, FilePath(..), (</>))
10import System.Exit (ExitCode(..)) 10import System.Exit (ExitCode(..))
11 11
@@ -50,6 +50,10 @@ compileTex' input tmpDir = do
50 when (exitCode /= ExitSuccess) $ do 50 when (exitCode /= ExitSuccess) $ do
51 hPutStrLn stdout out 51 hPutStrLn stdout out
52 hPutStrLn stderr err 52 hPutStrLn stderr err
53 (srcF, srcH) <- flip openTempFile "source.tex" =<< getTemporaryDirectory
54 hPutStrLn srcH input
55 hClose srcH
56 hPutStrLn stdout $ "Tex source saved to " ++ srcF
53 throwIO exitCode 57 throwIO exitCode
54 (\x -> return $!! (x, extractAlignment err)) =<< (readFile $ tmpDir </> "image.svg") 58 (\x -> return $!! (x, extractAlignment err)) =<< (readFile $ tmpDir </> "image.svg")
55 where 59 where