yadm-dev / yadm

Yet Another Dotfiles Manager
https://yadm.io/
GNU General Public License v3.0
5.11k stars 175 forks source link

env substitutions not occuring with default template processor #486

Closed coljac closed 5 months ago

coljac commented 5 months ago

Describe the bug

When using {{env.VAR}} in a template (##template.default), the resulting output contains the literal {{env.VAR}}, unsubstituted. {{yadm.x}} work as expected.

To reproduce

test.txt##template:

# All lines should be substituted
{{ yadm.hostname }}
{{ yadm.distro }}
{{ env.HOME }}
{{ env.PWD }}

Can this be reproduced with the yadm/testbed docker image: No

In the testbed, it works as expected.

Steps to reproduce the behavior:

echo '{{ env.HOME }}' > "test.txt##template"
yadm add "test.txt##template"
cat test.txt

Expected behavior

I should see {{ env.HOME }} replaced with the appropriate value of $HOME. Instead I see '{{ env.HOME }}', e.g.

myhost
ubuntu
{{ env.HOME }}
{{ env.PWD }}

Environment

Other

How could I best help debug this?

rasa commented 5 months ago

You need 3.2.2

coljac commented 5 months ago

You are right. I did not realise it was a new feature. Apologies!