From 8ad3a3bc6fcec8bcc0fc59385cae67e84df8b0bf Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 10 Jun 2024 18:31:58 +0200 Subject: [PATCH] helpers2.1: remove old internal ynh_render_template, should use ynh_add_config --jinja instead --- helpers/helpers.v2.1.d/templating | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/helpers/helpers.v2.1.d/templating b/helpers/helpers.v2.1.d/templating index 4f5bf25d0..64f9beb53 100644 --- a/helpers/helpers.v2.1.d/templating +++ b/helpers/helpers.v2.1.d/templating @@ -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 -}