Use ":add" in generated ghci-script #1888

This commit is contained in:
Michael Sloan 2016-05-15 06:23:11 -07:00
parent e1f14bf6ad
commit 6d24e49f2c
2 changed files with 4 additions and 1 deletions

View file

@ -26,6 +26,9 @@ Behavior changes:
* `stack upgrade` no longer pays attention to local stack.yaml files, just the
global config and CLI options.
[#1392](https://github.com/commercialhaskell/stack/issues/1392)
* `stack ghci` now uses `:add` instead of `:load`, making it potentially work
better with user scripts. See
[#1888](https://github.com/commercialhaskell/stack/issues/1888)
Other enhancements:

View file

@ -159,7 +159,7 @@ ghci opts@GhciOpts{..} = do
else do
let scriptPath = tmpDir </> $(mkRelFile "ghci-script")
fp = toFilePath scriptPath
loadModules = ":load " <> unwords (map show modulesToLoad)
loadModules = ":add " <> unwords (map show modulesToLoad)
addMainFile = maybe "" ((":add " <>) . toFilePath) mainFile
bringIntoScope = ":module + " <> unwords modulesToLoad
liftIO (writeFile fp (unlines [loadModules,addMainFile,bringIntoScope]))