Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiline environment variables #120

Open
Aegdesil opened this issue Oct 17, 2023 · 1 comment
Open

Handle multiline environment variables #120

Aegdesil opened this issue Oct 17, 2023 · 1 comment

Comments

@Aegdesil
Copy link

I have an issue when parsing multiline environment variables, the cli is not able to parse them.

export TEST_VALUE='first line
next line'

env | jinja2 --format env my_file.txt

This raises a ValueError because the environment variables file is parsed line by line, and the second line does not contain a variable name.

How can I handle such variables ?

@magf
Copy link

magf commented Nov 19, 2023

~/test: $ cat my_file.txt
Print {{ environ('TEST_VALUE') }}

~/test: $ export TEST_VALUE='first line
next line'

~/test: $ jinja2 my_file.txt
Print first line
next line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants