mirror of
https://github.com/carp-lang/Carp.git
synced 2024-10-12 04:58:18 +03:00
Cleanup reading of file.
This commit is contained in:
parent
e35178ccf8
commit
987c2bb172
@ -7,7 +7,6 @@ import Data.Maybe (fromJust, mapMaybe, isJust)
|
||||
import Control.Monad.State
|
||||
import Control.Monad.State.Lazy (StateT(..), runStateT, liftIO, modify, get, put)
|
||||
import System.Exit (exitSuccess, exitFailure, exitWith, ExitCode(..))
|
||||
import System.IO (hPutStr)
|
||||
import qualified System.IO as SysIO
|
||||
import System.Directory (doesPathExist)
|
||||
import Control.Concurrent (forkIO)
|
||||
@ -795,10 +794,9 @@ commandLoad [XObj (Str path) _ _] =
|
||||
return dynamicNil
|
||||
firstPathFound : _ ->
|
||||
do contents <- liftIO $ do --putStrLn ("Will load '" ++ firstPathFound ++ "'")
|
||||
-- readFile firstPathFound
|
||||
h <- SysIO.openFile firstPathFound SysIO.ReadMode
|
||||
SysIO.hSetEncoding h SysIO.utf8
|
||||
SysIO.hGetContents h
|
||||
handle <- SysIO.openFile firstPathFound SysIO.ReadMode
|
||||
SysIO.hSetEncoding handle SysIO.utf8
|
||||
SysIO.hGetContents handle
|
||||
let files = projectFiles proj
|
||||
files' = if firstPathFound `elem` files
|
||||
then files
|
||||
|
Loading…
Reference in New Issue
Block a user