Closed bitemyapp closed 7 years ago
I'm sure I can do something here, but first question, why not just run over all the projects at once? Does your root stack.yaml
list all the child projects? Are you hoping to add a Weeder target that only runs on a single project? You can run weeder ..
to check the parent project, but it sounds like maybe what you want is an option to restrict which projects are looked at?
One other use case where this is needed that I encountered straight away: I use Nix on osx to do general testing/development and that requires changes to stack.yaml to get to work. When I run off the same checkout to build something for say linux sans nix I strip that config out of stack.yaml and then set STACK_YAML to that copied/stripped config file without nix references.
This is affecting us as well in production, where we want to have separate stack.yaml files for Windows and Linux (some projects only build in one of the two os's, guess which).
FWIW stack path --config-location
will give you the path to the stack.yaml file
Thanks @pepeiborra - I'll give that solution a try, as it makes the code nice and generic.
I believe weeder let's you pass a stack.yaml file as an argument, so it should work now. I'm trying to make it work better though.
It does now, please try with weeder-0.1.7 and reopen if it fails. Thanks @pepeiborra for the trick, works really well.
I mostly work on monorepos that have one
stack.yaml
file at the top level of a multi-package git repository. Accordingly, most of my Makefiles look something like:What I'd like to be able to do is to use
STACK_YAML="../stack.yaml"
but it seems to unconditionally look for the file at./
which makes running it on a single package impossible for the moment.