mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
helpers2.1: remove old internal ynh_render_template, should use ynh_add_config --jinja instead
This commit is contained in:
parent
2a6a8af0f7
commit
8ad3a3bc6f
1 changed files with 0 additions and 20 deletions
|
@ -386,23 +386,3 @@ ynh_write_var_in_file() {
|
|||
fi
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue