Skip to content

Commit cde5e45

Browse files
committed
Merge branch 'stable'
2 parents 9b07d28 + 6a26ee2 commit cde5e45

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

doc/script_command.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ The `stack script` command either runs a specified Haskell source file (using
1313
GHC's `runghc`) or, optionally, compiles such a file (using GHC) and, by
1414
default, runs it.
1515

16-
Unlike [`stack ghc`](ghc_command.md) and [`stack runghc`](runghc_command.md),
17-
the command ignores any project-level configuration file (`stack.yaml`, by
18-
default) (including in the `global-project` directory in the Stack root). A
19-
snapshot must be specified on the command line (with the `--snapshot` option).
20-
For example:
16+
Unlike the [`stack ghc`](ghc_command.md) and [`stack runghc`](runghc_command.md)
17+
commands, the command ignores any project-level configuration file
18+
(`stack.yaml`, by default) (including in the `global-project` directory in the
19+
Stack root). Consequently, a snapshot must be specified on the command line
20+
(with the `--snapshot` option). For example:
2121

2222
~~~text
2323
stack script --snapshot lts-22.21 MyScript.hs
@@ -26,8 +26,8 @@ stack script --snapshot lts-22.21 MyScript.hs
2626
!!! info
2727

2828
Non-project level configuration options in global configuration files
29-
(`config.yaml`), are not ignored. Such options may be useful if
30-
[`allow-newer`](yaml_configuration.md#allow-newer) and/or
29+
(`config.yaml`), are not ignored by the `stack script` command. Such options
30+
may be useful if [`allow-newer`](yaml_configuration.md#allow-newer) and/or
3131
[`allow-newer-deps`](yaml_configuration.md#allow-newer-deps) are required.
3232

3333
The `stack script` command behaves as if the `--install-ghc` flag had been

doc/scripts.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,24 @@ providing a comma or space separated list. For example:
170170

171171
## Stack configuration for scripts
172172

173-
As with using [`stack script`](script_command.md) at the command line, any
174-
project-level configuration file (`stack.yaml`, by default) (including in the
175-
`global-project` directory in the Stack root) is ignored.
173+
When using the [`stack script`](script_command.md) command, as when using it at
174+
the command line, any project-level configuration file (`stack.yaml`, by
175+
default) (including in the `global-project` directory in the Stack root),
176+
including any specified by the options to the `stack script` command itself, is
177+
ignored.
176178

177179
!!! info
178180

179181
Non-project level configuration options in global configuration files
180-
(`config.yaml`), are not ignored.
181-
182-
With the [`stack runghc`](runghc_command.md) command, if the current working
183-
directory is inside a project then that project's Stack project-level
184-
configuration file is effective when running the script. Otherwise the script
185-
uses the project-level configuration file in the `global-project` directory of
186-
the Stack root.
182+
(`config.yaml`), are not ignored by the [`stack script`](script_command.md)
183+
command. Such options may be useful if
184+
[`allow-newer`](yaml_configuration.md#allow-newer) and/or
185+
[`allow-newer-deps`](yaml_configuration.md#allow-newer-deps) are required.
186+
187+
When using the [`stack runghc`](runghc_command.md) command, as when using it at
188+
the command line, if the current working directory is inside a project, then
189+
that project's project-level configuration file is effective when running the script. Otherwise the script uses the project-level configuration file in the
190+
`global-project` directory in the Stack root.
187191

188192
## Testing scripts
189193

0 commit comments

Comments
 (0)