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

Look for taskfiles under different workspace folders #128

Open
Welding-Torch opened this issue Mar 26, 2024 · 6 comments
Open

Look for taskfiles under different workspace folders #128

Welding-Torch opened this issue Mar 26, 2024 · 6 comments
Labels
area: input Changes related to the reading of Taskfiles. type: feature A new feature or functionality.

Comments

@Welding-Torch
Copy link

So I tend to have my taskfile placed inside a sub-folder in my project, next to where my code is. It would be really convenient if the Taskfile extension could detect that Taskfile.yml and show it to me in the sidebar.

Thanks devs.

@Welding-Torch
Copy link
Author

@pd93

@pd93 pd93 added state: needs triage Waiting to be triaged by a maintainer. type: feature A new feature or functionality. area: input Changes related to the reading of Taskfiles. and removed state: needs triage Waiting to be triaged by a maintainer. labels Apr 5, 2024
@robbarrett
Copy link

I'm also looking for a way to do this. My project has lots of subfolders with different build processes, each driven by their own Taskfile.yml. Since there isn't one in the root directory for the project, I am stuck with the extension saying: "No Taskfile found in this workspace. Click the button below to get started and initialize a new Taskfile. (Initialize Taskfile)"

@aacebedo
Copy link

same here. Would be great to have a way to scan for taskfiles in a folder hirerarchy

@jamcow
Copy link

jamcow commented Jun 28, 2024

I searched for this issue too, and solved it manually by adding a root Taskfile.yml (using the Initialize Taskfile button in VSCode) and then including the various Taskfiles wherever they existed. Tasks from the various subfolder tasks are listed and linked in the panel.

Could be worth adding a commented-out "includes example" in the initialize example, or link to documentation.

version: '3'

includes:
  anamespaceforthisfolder:
    taskfile: ./my.Project/Base/Taskfile.yml

  frontend:
    taskfile: ./my.Project/Frontend/Taskfile.yml

  backend:
    taskfile: ./my.Project/Backend/Taskfile.yml

@robbarrett
Copy link

That works really well for me, @jamcow -- thank you! Agreed that it would be good to put an example in the docs, if this seems to be a common pattern.

For my situation, it was helpful to also add a dir specification for eachincludes clause, like this:

includes:
  anamespaceforthisfolder:
    taskfile: ./my.Project/Base/Taskfile.yml
    dir: ./my.Project/Base

@Welding-Torch
Copy link
Author

@jamcow thanks for sharing this method! I second adding this to the docs, it could help other ppl who want this without having to dig through GitHub Issues.

Still this is just a fix, and it would be really great if Task didn't need it at all. @pd93 it would be great if the Task extension could detect multiple task files nested within folders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: input Changes related to the reading of Taskfiles. type: feature A new feature or functionality.
Projects
None yet
Development

No branches or pull requests

5 participants