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

Multi-line variables with double quotes? #28

Closed
randallb opened this issue Jun 22, 2014 · 12 comments
Closed

Multi-line variables with double quotes? #28

randallb opened this issue Jun 22, 2014 · 12 comments

Comments

@randallb
Copy link

Is there interest in a PR to support multiple lines when a variable is delimited by quotes?

@jcblw
Copy link
Collaborator

jcblw commented Jun 23, 2014

Do you have an example of why you would want to use a multiple line variable and export it to the process.env?

@randallb
Copy link
Author

Private key. That's how we store it in heroku and aws.

On Mon, Jun 23, 2014 at 10:52 AM, Jacob Lowe notifications@github.com
wrote:

Do you have an example of why you would want to use a multiple line variable and export it to the process.env?

Reply to this email directly or view it on GitHub:
#28 (comment)

@jcblw
Copy link
Collaborator

jcblw commented Jun 23, 2014

Ah I see, I actually have done that before. 😄

I think this could be cool.
What are your thoughts @scottmotte or @maxbeatty ?

@motdotla
Copy link
Owner

Indeed, I like this idea - particularly for RSA keys. Please go for it @randallb.

@maxbeatty
Copy link
Contributor

I'm interested in seeing how it would be done. Nervous our file format may start to find its limitations and a more structured format (JSON, YAML, etc.) may be needed. Good luck!

@motdotla
Copy link
Owner

If anyone is wondering how to do this - until/if this functionality is built in. You can simply use \n newline characters

@randallb
Copy link
Author

Ooh. Good to know. I just had a baby so it's going to be a bit, but I want
to make this happen.

On Fri, Jun 27, 2014 at 6:54 PM, Scott Motte notifications@github.com
wrote:

If anyone is wondering how to do this - until/if this functionality is
built in. You can simply use \n newline characters


Reply to this email directly or view it on GitHub
#28 (comment).

@motdotla
Copy link
Owner

closing. use \n newlines for now.

@arcseldon
Copy link

Any update on this?

This issue was mysteriously closed - #196
This workaround is definitely not ideal for certs etc
https://github.com/motdotla/dotenv/blob/v4.0.0/test/.env#L10

Is there a technical impediment preventing its introduction?

@george-norris-salesforce
Copy link

george-norris-salesforce commented Aug 22, 2018

Wish there was a better solution for this. The\n workaround is not great.

@markbirbeck
Copy link

Another use case is SQL queries passed in via environment variables. It would be nice to be able to lay them out neatly, too.

@jorgeorpinel
Copy link

jorgeorpinel commented Apr 26, 2019

Hi. I this is definitely needed to match Ruby's dotenv standard (https://github.com/bkeepers/dotenv#multi-line-values).

And for me, the \n workaround doesn't even work, \n is being sent as part of the value... I'm using the latest version, 7.0.0
And if you accidentally leave any actual new lines in the value of the var in the .env file, all the \n strings will get added to the resulting value.

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

8 participants