ihaskell 0.7.0.2 → 0.7.0.3
raw patch · 2 files changed
+8/−4 lines, 2 files
Files
- ihaskell.cabal +1/−1
- main/Main.hs +7/−3
ihaskell.cabal view
@@ -7,7 +7,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.7.0.2+version: 0.7.0.3 -- A short (one-line) description of the package. synopsis: A Haskell backend kernel for the IPython project.
main/Main.hs view
@@ -18,6 +18,7 @@ import System.Directory import System.Process (readProcess, readProcessWithExitCode) import System.Exit (exitSuccess, ExitCode(ExitSuccess))+import Control.Exception (try, SomeException) import System.Environment (getArgs) #if MIN_VERSION_ghc(7,8,0) import System.Environment (setEnv)@@ -116,11 +117,14 @@ dir <- getIHaskellDir Stdin.recordKernelProfile dir profile +#if MIN_VERSION_ghc(7,8,0) -- Detect if we have stack- (exitCode, stackStdout, _) <- readProcessWithExitCode "stack" [] ""- let stack = exitCode == ExitSuccess && "The Haskell Tool Stack" `isInfixOf` stackStdout+ runResult <- try $ readProcessWithExitCode "stack" [] ""+ let stack = + case runResult :: Either SomeException (ExitCode, String, String) of + Left _ -> False+ Right (exitCode, stackStdout, _) -> exitCode == ExitSuccess && "The Haskell Tool Stack" `isInfixOf` stackStdout -#if MIN_VERSION_ghc(7,8,0) -- If we're in a stack directory, use `stack` to set the environment -- We can't do this with base <= 4.6 because setEnv doesn't exist. when stack $ do