From 8098108b58b8f412b92a72be36802a8ba38dff12 Mon Sep 17 00:00:00 2001 From: Vaibhav Sagar Date: Sat, 3 Aug 2019 12:58:39 -0400 Subject: [PATCH] ihaskell: remove argv0 dependency --- ihaskell.cabal | 1 - src/IHaskell/IPython.hs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ihaskell.cabal b/ihaskell.cabal index d9fbb595..7428fa9b 100644 --- a/ihaskell.cabal +++ b/ihaskell.cabal @@ -80,7 +80,6 @@ library split >= 0.2, stm -any, strict >=0.3, - system-argv0 -any, text >=0.11, time >= 1.6, transformers -any, diff --git a/src/IHaskell/IPython.hs b/src/IHaskell/IPython.hs index d745caf9..a6695514 100644 --- a/src/IHaskell/IPython.hs +++ b/src/IHaskell/IPython.hs @@ -17,11 +17,11 @@ import IHaskellPrelude import qualified Data.Text as T import qualified Data.Text.Lazy as LT -import System.Argv0 import qualified Shelly as SH import qualified System.IO as IO import qualified System.FilePath as FP import System.Directory +import System.Environment (getExecutablePath) import System.Exit (exitFailure) import Data.Aeson (toJSON) import Data.Aeson.Text (encodeToTextBuilder) @@ -178,7 +178,7 @@ subHome path = SH.shelly $ do getIHaskellPath :: SH.Sh FilePath getIHaskellPath = do -- Get the absolute filepath to the argument. - f <- T.unpack <$> SH.toTextIgnore <$> liftIO getArgv0 + f <- liftIO getExecutablePath -- If we have an absolute path, that's the IHaskell we're interested in. if FP.isAbsolute f