-
-
Notifications
You must be signed in to change notification settings - Fork 763
Closed
Description
Thanks for your bug report!
Before submitting this issue, please make sure the same problem was
not already reported by someone else.Please describe the bug you're facing. Consider pasting example
Taskfiles showing how to reproduce the problem.
- Task version: v3.21.0
- Operating System: darwin/arm64
I tried to use the typical Cmd structure within a defer-ed command:
version: '3'
tasks:
hello:
cmds:
- mkdir -p testdir
- defer:
cmd: "rm -rf testdir"
silence: true
- echo "Hello, World!" > testdir/hello.txt
- cat testdir/hello.txtAnd running task hello resulted in:
$ task hello
task: Failed to parse Taskfile.yaml:
yaml: line 6: invalid keys in command
Turns out, both cmd and silence are invalid keys within defer, which was surprising to me since the examples look like the syntax for a non-deferred command.
Not sure if this is a bug or a feature request, but I'm going to guess bug since this was a surprising outcome (to me at least).
Is there some reason that the defer structure isn't just a Cmd that disallows nested defers?
ikrauchanka, micheal-hill-sportsbet and cosmopetrich
Metadata
Metadata
Assignees
Labels
No labels