env COW=mooooooo
exec hof gen data.cue -T template.txt -t a=A -t baz=BOP --inject-env
cmp stdout expected.txt

-- data.cue --
a: *"a" | string @tag(a)
b: 2

val: foo: "bar"

dir: *"dir" | string @tag(dir,var=cwd)

cow: *"moo" | string @tag(cow,var=COW)

baz: *"bop" | string @tag(baz,var=BAZ)

-- template.txt --
A is {{ .a }}
B is {{ .b }}

foo is {{ .val.foo }}
cow is {{ .cow }}
baz is {{ .baz }}
-- expected.txt --
A is A
B is 2

foo is bar
cow is mooooooo
baz is BOP
