Sibi
Sibi

Reputation: 48654

Invoking stack command on specific stack.yaml file

I have a multiple stack based yaml files for different resolvers in my Haskell project.

$ 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 ? By default, it picks up stack.yaml file.

Upvotes: 0

Views: 120

Answers (2)

jneira
jneira

Reputation: 944

The flag --stack-yaml file works for me too. Not sure if it is available for all versions though. Tested with stack version 1.7.1

Upvotes: 1

Sibi
Sibi

Reputation: 48654

To invoke the build process for a different stack yaml file, you need to set the STACK_YAML environment variable appropriately. Sample demo in bash:

$ STACK_YAML='stack-lts-12.yaml' stack build
...
...

Upvotes: 1

Related Questions