Skip to content

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

@marvinroger

Description

@marvinroger

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions