diff --git a/ChangeLog.md b/ChangeLog.md index 8fc67238c8..b55ed1964f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -76,6 +76,8 @@ Bug fixes: package keys even for very long package names. * The Error S-6362 message now acknowledges when the wanted compiler has been specified at the command line. +* Fix a regression, introduced in Stack 2.11.1, that caused the `script` command + to parse an (otherwise ignored) project-level configuration file. ## v2.15.7 - 2024-05-12 diff --git a/src/Stack/Script.hs b/src/Stack/Script.hs index f555a22d65..3735a8b737 100644 --- a/src/Stack/Script.hs +++ b/src/Stack/Script.hs @@ -164,9 +164,10 @@ scriptCmd opts = do then (NoRun, SECompile) else (opts.shouldRun, opts.compile) - root <- withConfig NoReexec $ view stackRootL outputDir <- if opts.useRoot then do + root <- local (over globalOptsL modifyGO) $ + withConfig NoReexec $ view stackRootL scriptFileAsDir <- maybe (throwIO $ FailedToParseScriptFileAsDirBug scriptFile) pure