helpers2.1: remove old internal ynh_render_template, should use ynh_add_config --jinja instead

This commit is contained in:
Alexandre Aubin 2024-06-10 18:31:58 +02:00
parent 2a6a8af0f7
commit 8ad3a3bc6f

View file

@ -386,23 +386,3 @@ ynh_write_var_in_file() {
fi fi
set -o xtrace # set -x set -o xtrace # set -x
} }
# Render templates with Jinja2
#
# [internal]
#
# Attention : Variables should be exported before calling this helper to be
# accessible inside templates.
#
# usage: ynh_render_template some_template output_path
# | arg: some_template - Template file to be rendered
# | arg: output_path - The path where the output will be redirected to
ynh_render_template() {
local template_path=$1
local output_path=$2
mkdir -p "$(dirname $output_path)"
# Taken from https://stackoverflow.com/a/35009576
python3 -c 'import os, sys, jinja2; sys.stdout.write(
jinja2.Template(sys.stdin.read()
).render(os.environ));' <$template_path >$output_path
}