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

add support for reading in environment variables from a file #2090

Merged
merged 2 commits into from
May 27, 2019

Conversation

tsloughter
Copy link
Collaborator

Resolves #2085

@tsloughter tsloughter force-pushed the env-file branch 5 times, most recently from ae1437f to 7fabba2 Compare May 25, 2019 18:58
@tsloughter
Copy link
Collaborator Author

I think this is ready now. I based the rules on what works when doing source file. So lines starting with # are ignored and if there are spaces around the = it is also a failure which is ignored in our case. Hm, maybe it should print a warning or a debug message if it is ignoring a line that is not a comment and not blank...

@tsloughter tsloughter force-pushed the env-file branch 2 times, most recently from c59bb94 to b95712b Compare May 25, 2019 19:17
src/rebar_prv_shell.erl Outdated Show resolved Hide resolved
src/rebar_prv_shell.erl Outdated Show resolved Hide resolved
Co-Authored-By: Fred Hebert <mononcqc@ferd.ca>
@ferd ferd merged commit 6c677cd into erlang:master May 27, 2019
@darkcat013
Copy link

This does not work properly if the newline is \r\n instead of just \n, it leaves the \r at the end of the env variable.

ferd added a commit to ferd/rebar3 that referenced this pull request May 23, 2023
As reported in a comment in erlang#2090
the current mechanism only breaks on a \n and does not even respect the
\r\n grapheme cluster. So instead of using string functions, we go to
regular expressions where we can specify both endings without a problem.
ferd added a commit to ferd/rebar3 that referenced this pull request May 23, 2023
As reported in a comment in erlang#2090
the current mechanism only breaks on a \n and does not even respect the
\r\n grapheme cluster. So instead of using string functions, we go to
regular expressions where we can specify both endings without a problem.
@ferd
Copy link
Collaborator

ferd commented May 23, 2023

This does not work properly if the newline is \r\n instead of just \n, it leaves the \r at the end of the env variable.

See if #2793 works for you?

ferd added a commit to ferd/rebar3 that referenced this pull request May 23, 2023
As reported in a comment in erlang#2090
the current mechanism only breaks on a \n and does not even respect the
\r\n grapheme cluster. So instead of using string functions, we go to
regular expressions where we can specify both endings without a problem.
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 this pull request may close these issues.

Shell env_file configuration
3 participants