diff --git a/CHANGELOG.md b/CHANGELOG.md index 8498408a..6622ce53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,12 @@ ## Unreleased -- Add support for yaml extension ([#584](https://github.com/go-task/task/issues/584)) +- Remove long deprecated and undocumented `$` variable prefix and `^` command + prefix + ([#642](https://github.com/go-task/task/issues/642), [#644](https://github.com/go-task/task/issues/644), [#645](https://github.com/go-task/task/pull/645)). +- Add support for `.yaml` extension (as an alternative to `.yml`). + This was requested multiple times throughout the years. Enjoy! + ([#183](https://github.com/go-task/task/issues/183), [#184](https://github.com/go-task/task/pull/184), [#369](https://github.com/go-task/task/issues/369), [#584](https://github.com/go-task/task/issues/584), [#621](https://github.com/go-task/task/pull/621)). ## v3.9.2 - 2021-12-02 diff --git a/taskfile/cmd.go b/taskfile/cmd.go index 9835e8c0..7166371b 100644 --- a/taskfile/cmd.go +++ b/taskfile/cmd.go @@ -1,9 +1,5 @@ package taskfile -import ( - "strings" -) - // Cmd is a task command type Cmd struct { Cmd string @@ -23,11 +19,7 @@ type Dep struct { func (c *Cmd) UnmarshalYAML(unmarshal func(interface{}) error) error { var cmd string if err := unmarshal(&cmd); err == nil { - if strings.HasPrefix(cmd, "^") { - c.Task = strings.TrimPrefix(cmd, "^") - } else { - c.Cmd = cmd - } + c.Cmd = cmd return nil } var cmdStruct struct { diff --git a/taskfile/var.go b/taskfile/var.go index 502ff5cc..fbda3895 100644 --- a/taskfile/var.go +++ b/taskfile/var.go @@ -2,7 +2,6 @@ package taskfile import ( "errors" - "strings" "gopkg.in/yaml.v3" ) @@ -108,11 +107,7 @@ type Var struct { func (v *Var) UnmarshalYAML(unmarshal func(interface{}) error) error { var str string if err := unmarshal(&str); err == nil { - if strings.HasPrefix(str, "$") { - v.Sh = strings.TrimPrefix(str, "$") - } else { - v.Static = str - } + v.Static = str return nil } diff --git a/testdata/vars/v2/Taskfile.yml b/testdata/vars/v2/Taskfile.yml index 90f36993..7f533c5d 100644 --- a/testdata/vars/v2/Taskfile.yml +++ b/testdata/vars/v2/Taskfile.yml @@ -35,7 +35,8 @@ tasks: - echo '{{.TASK}}' > task_name.txt vars: FOO: foo - BAR: $echo bar + BAR: + sh: echo bar BAZ: sh: echo baz TMPL_FOO: "{{.FOO}}" diff --git a/testdata/vars/v2/Taskvars.yml b/testdata/vars/v2/Taskvars.yml index 62b1739a..576f988e 100644 --- a/testdata/vars/v2/Taskvars.yml +++ b/testdata/vars/v2/Taskvars.yml @@ -1,5 +1,6 @@ FOO2: foo2 -BAR2: $echo bar2 +BAR2: + sh: echo bar2 BAZ2: sh: echo baz2 TMPL2_FOO: "{{.FOO}}"