summaryrefslogtreecommitdiff
path: root/app/ghci.hs
diff options
context:
space:
mode:
Diffstat (limited to 'app/ghci.hs')
-rw-r--r--app/ghci.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/ghci.hs b/app/ghci.hs
new file mode 100644
index 0000000..230cdde
--- /dev/null
+++ b/app/ghci.hs
@@ -0,0 +1,19 @@
+module Main where
+
+import StackWrapper
+
+import qualified GhcLib as G
+
+import System.Environment
+import System.FilePath
+import System.Process
+
+main :: IO ()
+main =
+ run $ G.run "ghci" $ do
+ args <- getArgs
+ binDir <- head . lines <$> readProcess "stack" ["path", "--compiler-bin"] ""
+ globalPackageDB <- head . lines <$> readProcess "stack" ["path", "--global-pkg-db"] ""
+ snapshotPackageDB <- head . lines <$> readProcess "stack" ["path", "--snapshot-pkg-db"] ""
+ localPackageDB <- head . lines <$> readProcess "stack" ["path", "--local-pkg-db"] ""
+ callProcess (binDir </> "ghci") ("-package-db":globalPackageDB:"-package-db":snapshotPackageDB:"-package-db":localPackageDB:args)