Skip to content
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

Closed
wtcross opened this issue Nov 5, 2019 · 3 comments
Closed

Task directory for included Taskfiles #260

wtcross opened this issue Nov 5, 2019 · 3 comments

Comments

@wtcross
Copy link

wtcross commented Nov 5, 2019

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 the Taskfile struct and massaging how tasks are run could enable a Task to have the following level of precedence for its directory:

  1. Set at Task level
  2. Parent Taskfile (might not be the root directory of the project)
  3. Root Taskfile directory
@wtcross
Copy link
Author

wtcross commented Nov 5, 2019

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.

@andreynering andreynering added the type: feature A new feature or functionality. label Nov 10, 2019
@andreynering
Copy link
Member

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.

@andreynering
Copy link
Member

@wtcross As this is a duplicate of #144, I'll close this.

And FYI, this is a WIP right now: #292

@pd93 pd93 removed the type: feature A new feature or functionality. label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants