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

fix(#584): Add support to yaml extension

- init creates Taskfile.yaml
- add changelog entry
- add zsh completion support for Taskfile.yaml
This commit is contained in:
Margus Kerma
2021-12-04 17:37:52 +02:00
parent 17e18442ab
commit 1d7982e80a
21 changed files with 211 additions and 87 deletions

View File

@ -3,7 +3,6 @@ package task
import (
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
)
@ -24,15 +23,15 @@ tasks:
// InitTaskfile Taskfile creates a new Taskfile
func InitTaskfile(w io.Writer, dir string) error {
f := filepath.Join(dir, "Taskfile.yml")
f := filepath.Join(dir, "Taskfile.yaml")
if _, err := os.Stat(f); err == nil {
return ErrTaskfileAlreadyExists
}
if err := ioutil.WriteFile(f, []byte(defaultTaskfile), 0644); err != nil {
if err := os.WriteFile(f, []byte(defaultTaskfile), 0644); err != nil {
return err
}
fmt.Fprintf(w, "Taskfile.yml created in the current directory\n")
fmt.Fprintf(w, "Taskfile.yaml created in the current directory\n")
return nil
}