1
0
mirror of https://github.com/go-task/task.git synced 2025-11-25 22:32:55 +02:00

feat: custom error codes (#1114)

This commit is contained in:
Pete Davison
2023-04-15 21:22:25 +01:00
committed by GitHub
parent 9ec544817f
commit f9c77acd96
12 changed files with 286 additions and 129 deletions

View File

@@ -5,6 +5,7 @@ import (
"io"
"os"
"github.com/go-task/task/v3/errors"
"github.com/go-task/task/v3/internal/filepathext"
)
@@ -29,7 +30,7 @@ func InitTaskfile(w io.Writer, dir string) error {
f := filepathext.SmartJoin(dir, defaultTaskfileName)
if _, err := os.Stat(f); err == nil {
return ErrTaskfileAlreadyExists
return errors.TaskfileAlreadyExistsError{}
}
if err := os.WriteFile(f, []byte(defaultTaskfile), 0o644); err != nil {