Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Support the STACK_YAML environment variable (or add --stack-yaml) #740

Open
pjones opened this issue Feb 1, 2016 · 2 comments
Open

Support the STACK_YAML environment variable (or add --stack-yaml) #740

pjones opened this issue Feb 1, 2016 · 2 comments

Comments

@pjones
Copy link

pjones commented Feb 1, 2016

Stack allows you to specify an alternate location for the stack.yaml file using the --stack-yaml command line option or the STACK_YAML environment variable. I don't like to clutter up the root directory of my repositories so I store my stack.yaml files in a build directory.

ghc-mod should allow you to specify an alternate location for the stack.yaml file using either a new command line option or by respecting the STACK_YAML environment variable.

It's actually recommended in the stack documentation to have multiple YAML files if you want to support multiple resolvers. This would be another motivation for supporting alternate stack configuration files in ghc-mod.

@DanielG
Copy link
Owner

DanielG commented Feb 2, 2016

This should be very easy to add. Here is the code that looks for stack.yaml:

findStackConfigFile :: FilePath -> IO (Maybe FilePath)

The path isn't used anywhere we only use this to check for it's existence and invoke stack directly for everything else. So all you need to do is insert the appropriate logic there and it should work.

@pjones
Copy link
Author

pjones commented Feb 9, 2016

PR forthcoming.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants