feat: support bashrc aliases, envs and functions
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-03-02 19:20:05 +01:00
parent 75fea198c2
commit 5907f1617a
4 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#
# {{ ansible_managed }}
#
{% if shell_rc_file.functions is defined %}
{% for function in shell_rc_file.functions %}
function {{ function.name }} {
{{ function.body | indent(2, True) }}
}
{% endfor %}
{% endif %}
{% if shell_rc_file.envs is defined %}
{% for env in shell_rc_file.envs %}
{{ 'export ' if env.export is defined and env.export }}{{ env.key }}="{{ env.value }}"
{% endfor %}
{% endif %}
{% if shell_rc_file.aliases is defined %}
{% for alias in shell_rc_file.aliases %}
alias {{ alias.key }}='{{ alias.value }}'
{% endfor %}
{% endif %}