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:
7
init.go
7
init.go
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user