[英]Invoking stack command on specific stack.yaml file
I have a multiple stack based yaml files for different resolvers in my Haskell project. 我的Haskell项目中有多个基于堆栈的yaml文件用于不同的解析器。
$ ls *yaml
stack.yaml
stack-lts-12.yaml
stack-lts-11.yaml
stack-lts-10.yaml
How can I invoke the stack
build command for a specific yaml file ? 如何调用特定yaml文件的
stack
build命令? By default, it picks up stack.yaml
file. 默认情况下,它将拾取
stack.yaml
文件。
To invoke the build process for a different stack yaml file, you need to set the STACK_YAML
environment variable appropriately. 要为其他堆栈yaml文件调用构建过程,需要适当设置
STACK_YAML
环境变量。 Sample demo in bash: bash中的示例演示:
$ STACK_YAML='stack-lts-12.yaml' stack build
...
...
The flag --stack-yaml file
works for me too. 标志
--stack-yaml file
对我--stack-yaml file
。 Not sure if it is available for all versions though. 但不确定是否适用于所有版本。 Tested with stack version 1.7.1
使用堆栈版本1.7.1测试
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.