Skip to content

Commit

Permalink
Have ghci --main-is imply an extra target #1845
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Oct 18, 2016
1 parent 47bcd49 commit dcaf52e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Stack/Ghci.hs
Expand Up @@ -319,7 +319,9 @@ ghciSetup
=> GhciOpts
-> m (Map PackageName SimpleTarget, Maybe (Map PackageName SimpleTarget), [GhciPkgInfo])
ghciSetup GhciOpts{..} = do
(_,_,targets) <- parseTargetsFromBuildOpts AllowNoTargets ghciBuildOptsCLI
let boptsCli0 = ghciBuildOptsCLI
{ boptsCLITargets = boptsCLITargets ghciBuildOptsCLI ++ maybeToList ghciMainIs }
(_,_,targets) <- parseTargetsFromBuildOpts AllowNoTargets boptsCli0
mainIsTargets <-
case ghciMainIs of
Nothing -> return Nothing
Expand All @@ -330,8 +332,8 @@ ghciSetup GhciOpts{..} = do
let mres = (packageIdentifierName <$> parsePackageIdentifierFromString name)
<|> parsePackageNameFromString name
maybe (throwM $ InvalidPackageOption name) return mres
let boptsCli = ghciBuildOptsCLI
{ boptsCLITargets = boptsCLITargets ghciBuildOptsCLI ++ map T.pack ghciAdditionalPackages
let boptsCli = boptsCli0
{ boptsCLITargets = boptsCLITargets boptsCli0 ++ map T.pack ghciAdditionalPackages
}
(realTargets,_,_,_,sourceMap) <- loadSourceMap AllowNoTargets boptsCli
when ghciNoBuild $ $logInfo $ T.unlines
Expand Down

0 comments on commit dcaf52e

Please sign in to comment.