Skip to content

Commit

Permalink
Show project msg when loading build config #2030
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Apr 13, 2016
1 parent c5ad629 commit 1ff3a7e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Stack/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,6 @@ loadConfig configArgs mstackYaml mresolver = do
extraConfigs0
mproject <- loadProjectConfig mstackYaml

let printUserMessage (p, _, _) =
maybe (return ()) ($logWarn . T.pack) (projectUserMsg p)
maybe (return ()) printUserMessage mproject

let mproject' = (\(project, stackYaml, _) -> (project, stackYaml)) <$> mproject
config <- configFromConfigMonoid stackRoot userConfigPath mresolver mproject' $ mconcat $
case mproject of
Expand Down Expand Up @@ -440,7 +436,9 @@ loadBuildConfig mproject config mresolver mcompiler = do
miniConfig <- loadMiniConfig config

(project', stackYamlFP) <- case mproject of
Just (project, fp, _) -> return (project, fp)
Just (project, fp, _) -> do
forM_ (projectUserMsg project) ($logWarn . T.pack)
return (project, fp)
Nothing -> do
$logInfo "Run from outside a project, using implicit global project config"
destDir <- getImplicitGlobalProjectDir config
Expand Down

2 comments on commit 1ff3a7e

@mgsloan
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinging @harendra-kumar

The idea is that the project message is probably only relevant when loading up the build config. Otherwise, only a few parts of the config are really being used, and the message is probably not relevant.

On the other hand, this makes the feature harder to document. I'm open to reverting if this makes things too inhomogenous.

@harendra-kumar
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No big deal unless further use cases spring up which require it to behave otherwise.

Please sign in to comment.