Skip to content

Idea: Make --init more powerful by having Taskfile templates #2012

@andreynering

Description

@andreynering

From previous discussion in #2010 with @HeCorr. This is an idea for discussion, and we can discard if we think it'd not be worth it.

Our default Taskfile generated from --init is pretty basic. It's basically a skeleton so the user can start adding their own tasks.

In theory we could have some templates for each kind of app: Go, Rust, Ruby on Rails, npm, Yarn, Deno, Docker, etc. IMO they should still be basic, but would help the user by having a starting point.

Implementation wise, we could have a directory in our repository called templates with each template, and have that embed in the binary with go embed. Once --init=rails is called, it'll init with the Rails template, for example (templates/rails/Taskfile.yaml).

Additionally, we could allow the user to override these templates with a directory of his own. Not sure how it'd be more practical, if a CLI flag or an ENV like TASK_EXTRA_TEMPLATES_DIR, but we would merge those with our default templates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: uiChanges related to the UI of Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions