task icon indicating copy to clipboard operation
task copied to clipboard

Unable to use template variables to define task directory

Open npac opened this issue 2 years ago • 1 comments

  • Task version: 3.12.1
  • Operating System: Linux 5.10.16.3-microsoft-standard-WSL2 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Example Taskfile showing the issue

version: 3
tasks:
  test:
    dir: '{{dir .FILE}}'
    cmds:
     - echo {{.FILE}}
     - echo {{dir .FILE}}
     - pwd

Task execution fails with error

task --version 
Task version: v3.12.1 (h1:SmYDqaRgt9NOm/ogPaMviwckYCqCjbGek9DKF//5A2g=)
$ task test FILE=/etc/group 
template: :1:6: executing "" at <.FILE>: invalid value; expected string

Task version 3.11 has no such issue.

$ task --version 
Task version: v3.11.0 (h1:eCcCe1cKyta4YnGQYLo2FriPS9h7fFS8XBVW6QvWEV4=)
$ task test FILE=/etc/group 
task: [test] echo /etc/group
/etc/group
task: [test] echo /etc
/etc
task: [test] pwd
/etc

npac avatar Jun 07 '22 20:06 npac

@andreynering Do you think this issue is related to #828 ?

npac avatar Sep 15 '22 20:09 npac