Description
Task envars are not made available to the templater. This was probably the original intention, however with dotenv as a method of exchanging values between tasks it would be useful to have those envars also available in the templater.
global.env
task.env
Taskfile.yml
version: '3'
dotenv:
- global.env
tasks:
default:
desc: Print a greeting message
dotenv:
- task.env
env:
tbar: tbar
cmds:
- echo "env gfoo = $gfoo"
- echo "env tfoo = $tfoo"
- echo "env tbar = $tbar"
- echo "var gfoo = {{.gfoo}}"
- echo "var tfoo = {{.tfoo}}"
- echo "var tbar = {{.tbar}}"
silent: true
Output:
$ task -d ISSUES/997/
env gfoo = gfoo
env tfoo = tfoo
env tbar = tbar
var gfoo = gfoo
var tfoo =
var tbar =
Description
Task envars are not made available to the templater. This was probably the original intention, however with dotenv as a method of exchanging values between tasks it would be useful to have those envars also available in the templater.
global.env
task.env
Taskfile.yml
Output: