TheLocehiliosan / yadm

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

feat: Add support for env vars in templates #347

Closed rasa closed 2 years ago

rasa commented 3 years ago

What does this PR do?

Allows {{ env.HOME }} in templates.

What issues does this PR fix or reference?

This allows us to replace

{% if yadm.os == "Darwin" %}
home="/Users/{{ yadm.user }}"
{% else %}
home="/home/{{ yadm.user }}"
{% endif %}

with

home="{{ env.HOME }}"

Previous Behavior

See above.

New Behavior

See above.

Have tests been written for this change?

No. Sorry, I'm not skilled in writing tests in python.

Have these commits been signed with GnuPG?

Yes.


pkoch commented 2 years ago

@rasa: See https://github.com/rasa/yadm/pull/2 for some tests.

@TheLocehiliosan: Would that be enough to accept the PR? What else could we do to move this forward?

TheLocehiliosan commented 2 years ago

@pkoch - thanks for the tests. I'll try to include this PR before the release of 3.2.0.

TheLocehiliosan commented 2 years ago

I signed these commits, and merged this into develop.