-
-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task directory for included Taskfiles #260
Comments
I'd try to work on this if you're interested in this sort of contribution. It could break Taskfiles using v2 so I understand it would need to be carefully considered. |
Hi @wtcross, thanks for opening this issue! There's an open issue to track the ability of making included Taskfiles run on its own directory. Please let me know of your thoughts (would it suffice your use case?). Also, work on v3 (on the v3 branch), although slow, is ongoing. So this is the right time to consider adding that. Contribution is always welcome, but I'll probably do that myself at some point otherwise. In case you want to try, feel free to open a WIP PR and ask for direction/help if needed. |
Task Version: 2.7.0
It appears that a Task's directory is set to that of the root Taskfile if it is included and doesn't specify its own directory.
https://taskfile.dev/#/usage?id=task-directory
This was unexpected to me since it affects how file paths can be structured in included Taskfiles. The scenario that caused me to look at it this way was to use Task to replace Make for a monorepo. Right now it's working great, but I have to run all tasks from the root of the project if I want it to work. Ideally I'd be able to run the included Taskfiles, which are local to each package in the monorepo.
Is this something on the roadmap? After looking at the code it looks like adding a
Dir
field to theTaskfile
struct and massaging how tasks are run could enable a Task to have the following level of precedence for its directory:The text was updated successfully, but these errors were encountered: