Skip to content

Commit 93a7bd8

Browse files
committed
Fix #6484 stack path avoids EnvConfig where possible
1 parent 441df6f commit 93a7bd8

File tree

4 files changed

+164
-90
lines changed

4 files changed

+164
-90
lines changed

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Major changes:
1010

1111
Behavior changes:
1212

13+
* `stack path --global-config`, `--programs`, and `--local-bin` no longer set
14+
up Stack's environment.
15+
1316
Other enhancements:
1417

1518
Bug fixes:

doc/path_command.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# The `stack path` command
44

55
~~~text
6-
stack path [--stack-root] [--global-config] [--project-root] [--config-location]
7-
[--bin-path] [--programs] [--compiler-exe] [--compiler-bin]
8-
[--compiler-tools-bin] [--local-bin] [--extra-include-dirs]
6+
stack path [--stack-root] [--global-config] [--programs] [--local-bin]
7+
[--project-root] [--config-location] [--bin-path] [--compiler-exe]
8+
[--compiler-bin] [--compiler-tools-bin] [--extra-include-dirs]
99
[--extra-library-dirs] [--snapshot-pkg-db] [--local-pkg-db]
1010
[--global-pkg-db] [--ghc-package-path] [--snapshot-install-root]
1111
[--local-install-root] [--snapshot-doc-root] [--local-doc-root]

src/Stack/Options/PathParser.hs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,22 @@ module Stack.Options.PathParser
77

88
import qualified Data.Text as T
99
import Options.Applicative ( Parser, flag, help, long )
10-
import Stack.Path ( paths )
10+
import Stack.Path
11+
( pathsFromConfig, pathsFromEnvConfig, pathsFromRunner )
1112
import Stack.Prelude
1213

1314
-- | Parse command line arguments for Stack's @path@ command.
1415
pathParser :: Parser [Text]
1516
pathParser = mapMaybeA
16-
( \(desc, name, _) -> flag Nothing (Just name)
17+
( \(desc, name) -> flag Nothing (Just name)
1718
( long (T.unpack name)
1819
<> help desc
1920
)
2021
)
2122
paths
23+
where
24+
toDescName (desc, name, _) = (desc, name)
25+
paths =
26+
pathsFromRunner
27+
: map toDescName pathsFromConfig
28+
<> map toDescName pathsFromEnvConfig

0 commit comments

Comments
 (0)