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

Make Taskfile initialization less verbose by default #2011

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

HeCorr
Copy link
Contributor

@HeCorr HeCorr commented Jan 22, 2025

Fixes #2009.

When using the --init flag to create a new Taskfile, it currently prints the whole contents of the file to the terminal, which is unnecessarily verbose (and honestly seems to be unintentional).

This PR fixes it by only printing the filename by default and taking the --silent and --verbose flags into account to control the behavior:

$ task --init
Taskfile.yml created in the current directory
$ task --init --silent
$ task --init --verbose
# https://taskfile.dev

version: '3'

vars:
  GREETING: Hello, World!

tasks:
  default:
    cmds:
      - echo "{{.GREETING}}"
    silent: true

Taskfile.yml created in the current directory

Please note that I purposefully did not update the description of the --silent and --verbose flags so please let me know if you want me to and what should I change them to.

When using --init to create a new Taskfile, it used to print the whole contents of the file to the terminal, which was unnecessarily verbose (and honestly felt unintentional).

Now only the filename is printed by default and the --silent and --verbose flags can be used to control the behavior (print nothing or content + filename, respectively).
it looks slightly better in the terminal.
@HeCorr
Copy link
Contributor Author

HeCorr commented Jan 22, 2025

I'm considering making the Taskfile.yml created in the current directory text green to differentiate it from the file content output if it is present. Thoughts?

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

Successfully merging this pull request may close these issues.

Taskfile initialization is too verbose
1 participant