diff --git a/README.md b/README.md index de109bad..fe1841bd 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,7 @@ your `PATH`. DEB and RPM packages are also available. ## Usage Create a file called `Taskfile.yml` in the root of the project. -(`Taskfile.toml` and `Taskfile.json` are also supported, but YAML is used in -the documentation). The `cmds` attribute should contains the commands of a -task: +The `cmds` attribute should contains the commands of a task: ```yml build: @@ -256,7 +254,7 @@ setvar: The above sample saves the path into a new variable which is then again echoed. You can use environment variables, task level variables and a file called -`Taskvars.yml` (or `Taskvars.toml` or `Taskvars.json`) as source of variables. +`Taskvars.yml` as source of variables. They are evaluated in the following order: diff --git a/example/Taskfile.json b/example/Taskfile.json deleted file mode 100644 index 032cf0e1..00000000 --- a/example/Taskfile.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "hello": { - "cmds": [ - "echo \"I am going to write a file named 'output.txt' now.\"", - "echo \"hello\" > output.txt" - ], - "generates": [ - "output.txt" - ] - } -} diff --git a/example/Taskfile.toml b/example/Taskfile.toml deleted file mode 100644 index c9e53661..00000000 --- a/example/Taskfile.toml +++ /dev/null @@ -1,6 +0,0 @@ -[hello] -cmds = [ - "echo \"I am going to write a file named 'output.txt' now.\"", - "echo \"hello\" > output.txt" -] -generates = ["output.txt"] diff --git a/read_taskfile.go b/read_taskfile.go index 2d26c8c4..ec48742c 100644 --- a/read_taskfile.go +++ b/read_taskfile.go @@ -1,13 +1,11 @@ package task import ( - "encoding/json" "fmt" "io/ioutil" "path/filepath" "runtime" - "github.com/BurntSushi/toml" "github.com/imdario/mergo" "gopkg.in/yaml.v2" ) @@ -43,12 +41,6 @@ func (e *Executor) readTaskfileData(path string) (tasks map[string]*Task, err er if b, err := ioutil.ReadFile(path + ".yml"); err == nil { return tasks, yaml.Unmarshal(b, &tasks) } - if b, err := ioutil.ReadFile(path + ".json"); err == nil { - return tasks, json.Unmarshal(b, &tasks) - } - if b, err := ioutil.ReadFile(path + ".toml"); err == nil { - return tasks, toml.Unmarshal(b, &tasks) - } return nil, taskFileNotFound{path} } @@ -59,19 +51,6 @@ func (e *Executor) readTaskvarsFile() error { if err := yaml.Unmarshal(b, &e.taskvars); err != nil { return err } - return nil - } - if b, err := ioutil.ReadFile(file + ".json"); err == nil { - if err := json.Unmarshal(b, &e.taskvars); err != nil { - return err - } - return nil - } - if b, err := ioutil.ReadFile(file + ".toml"); err == nil { - if err := toml.Unmarshal(b, &e.taskvars); err != nil { - return err - } - return nil } return nil }