1
0
mirror of https://github.com/go-task/task.git synced 2025-06-15 00:15:10 +02:00

Make --init generate .yml instead of .yaml (#1062)

This commit is contained in:
Misite Bao
2023-03-17 08:53:01 +08:00
committed by GitHub
parent 291ee123c9
commit 15ef1fa1c2
6 changed files with 19 additions and 14 deletions

View File

@ -22,9 +22,11 @@ tasks:
silent: true
`
const defaultTaskfileName = "Taskfile.yml"
// InitTaskfile Taskfile creates a new Taskfile
func InitTaskfile(w io.Writer, dir string) error {
f := filepathext.SmartJoin(dir, "Taskfile.yaml")
f := filepathext.SmartJoin(dir, defaultTaskfileName)
if _, err := os.Stat(f); err == nil {
return ErrTaskfileAlreadyExists
@ -33,6 +35,6 @@ func InitTaskfile(w io.Writer, dir string) error {
if err := os.WriteFile(f, []byte(defaultTaskfile), 0o644); err != nil {
return err
}
fmt.Fprintf(w, "Taskfile.yaml created in the current directory\n")
fmt.Fprintf(w, "%s created in the current directory\n", defaultTaskfile)
return nil
}