Merge pull request #221 from satoshi-murakumo/fix-windows-tempfile-handling
Fix windows tempfile handling
This commit is contained in:
commit
68f64639dc
@ -31,8 +31,9 @@ suppressStdout :: IO a -> IO a
|
|||||||
suppressStdout f = do
|
suppressStdout f = do
|
||||||
tmpdir <- getTemporaryDirectory
|
tmpdir <- getTemporaryDirectory
|
||||||
(path, handle) <- openTempFile tmpdir "ghc-mod-hlint"
|
(path, handle) <- openTempFile tmpdir "ghc-mod-hlint"
|
||||||
removeFile path
|
|
||||||
dup <- hDuplicate stdout
|
dup <- hDuplicate stdout
|
||||||
hDuplicateTo handle stdout
|
hDuplicateTo handle stdout
|
||||||
hClose handle
|
hClose handle
|
||||||
f `finally` hDuplicateTo dup stdout
|
f `finally` do
|
||||||
|
hDuplicateTo dup stdout
|
||||||
|
removeFile path
|
||||||
|
Loading…
Reference in New Issue
Block a user