Description
Are there plans to allow dir/entrypoint from sources other than flag/pwd?
I have early work on this in my fork, but would like to open the conversation before going too far with it.
Use case: task is amazing for monorepos, of course. But monorepos, by nature, may have you at any point in the file tree. It's nice to be able to run repo commands from x directory in the tree. (Eg: trigger a build while you're in path/to/go/service
that also builds the dep at path/to/vue/client
).
My initial thought was reverse-traversal, looking up the tree until a Taskfile.yml
is found, but that carries risk - a task can be intentionally destructive, and that's okay as long as you don't accidentally call it from the wrong place.
Also, it's restrictive. That becomes "the way" to find the root.
Allowing dir args from env
- puts some manual intervention
- allows flexibility: one person may find the dir by recurse-up to the closest taskfile, or may look for the closest .git, or set it as pwd before moving deeper. Whatever works.
- makes a happy CI environment. Most CIs pin a stable root for their stages, which would make it easy to set the env once and reliably call tasks from wherever the script may be.