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

--env-file does not support escaping quotes #50801

Closed
marvinroger opened this issue Nov 18, 2023 · 2 comments
Closed

--env-file does not support escaping quotes #50801

marvinroger opened this issue Nov 18, 2023 · 2 comments

Comments

@marvinroger
Copy link
Contributor

Version

20.9.0

Platform

Darwin REDACTED 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000 arm64

Subsystem

No response

What steps will reproduce the bug?

With a .env of:

ESCAPE_TEST="{\"foo\":\"bar\"}"

Run:

node --env-file .env -e "console.log(process.env.ESCAPE_TEST)"

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

I would expect the \ in \" to be stripped:

{"foo":"bar"}

What do you see instead?

{\"foo\":\"bar\"}

Additional information

No response

@pluris
Copy link
Contributor

pluris commented Nov 20, 2023

It seems to operate incompatible with dotenv.
It behaves differently from the behavior defined in the document, and it does not seem to be the behavior we want.
Please refer to below.

@marvinroger
Copy link
Contributor Author

Indeed, my bad! I fell into the same require('dotenv').parse trap as the one mentioned in the PR.
Thanks, closing!

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

Successfully merging a pull request may close this issue.

2 participants