1
0
mirror of https://github.com/go-task/task.git synced 2025-05-13 22:16:31 +02:00

7 Commits

Author SHA1 Message Date
Jay Berkenbilt
e65159f613
docs: clarify --dir flag (#2123)
Co-authored-by: Andrey Nering <andreynering@users.noreply.github.com>
2025-04-17 23:10:57 +00:00
Henrique Corrêa
0e23404d23
feat: specify --init filename/path (#2018)
* feat: specify init filename with --taskfile flag

previously, it was not possible to specify which filename to use when initializing a new Taskfile as it was hardcoded as "Taskfile.yml".

now the --taskfile flag specifies where to write the file to, and the first * contained in it will be replaced by "Taskfile", so `task -it *.yaml` will create a `Taskfile.yaml` file.

* docs: update CLI reference

* fix Flags header being inside tip admonition
* change -t flag's default column and add a description
* add Default Filenames section

* docs: revert adding Default Filenames section

I didn't realize it already existed elsewhere.

* refactor: use path instead of filepath on InitTaskFile

as requested to prevent ambiguity with the stdlib package.

* fix TestInit (incorrectly merged)

* docs: remove outdated info on --taskfile flag

* refactor task initialization changes

- remove const DefaultTaskInitFilename from taskfile/taskfile.go
- revert description of Entrypoint flag
- make InitTaskfile accept a path to either a file or a directory, and join the default Taskfile name+ext to it if it is a directory
- take the target file path from the first argument instead of the Entrypoint flag
- detect extension-only filenames (".yaml") instead of replacing "*" with "Taskfile"
- use different format in success log so that it makes sense at different paths than the current dir

* print colon instead of "at"

it's a lot cleaner in most cases.

* rewrite init tests

test both initializing to a directory path and a file path

* return final path from InitTaskfile

...and print it's relative representation

* fix lint error (ineffassign)

* use filepathext.TryAbsToRel() instead

* define and use filepathext.IsExtOnly()

* link to default filenames list in cli ref docs

(specifically in the --taskfile flag description)
2025-02-10 11:22:49 +00:00
Pete Davison
f5121de468
docs: broken links 2025-01-26 00:56:25 +00:00
Valentin Maerten
a35910429c
feat: option to ensure variable is within the list of values (#1827) 2024-10-18 18:16:57 +02:00
Samuel Marks
0be05795b9
docs: exit code zero is not an error (#1811) 2024-09-18 22:16:59 -03:00
Pete Davison
527bbc3bf5
fix: docs typos/links 2024-06-03 09:06:34 +00:00
Pete Davison
b0efbad591
docs: template reference (#1653)
* chore: deprecation warnings for template functions

* docs: update reference pages
2024-05-16 11:11:52 +01:00