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

Added functionality to ignore .env # comments, trim EOL whitespace, detect different EOL terminators #6

Merged
merged 5 commits into from
Aug 23, 2021

Conversation

seanblonien
Copy link
Contributor

@seanblonien seanblonien commented Aug 16, 2021

  • Valid .env file comments that start with #, so added functionality to ignore anything after that symbol
  • Also trimmed whitespace at end of line
  • Changed it to auto-detect the EOL and split the string accordingly (allowing for \r\n and \n line endings)

@kHRISl33t kHRISl33t self-requested a review August 17, 2021 14:01
Copy link
Owner

@kHRISl33t kHRISl33t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice touch to the package, good work, thank you! :)
One small comment about the style, otherwise it looks good.

lib/generateConfig.js Outdated Show resolved Hide resolved
@seanblonien
Copy link
Contributor Author

seanblonien commented Aug 17, 2021

If someone needs an environment variable value with a "#" in it, this solution doesn't really allow for that, but I think that's fine and not a common use-case, and easily solvable by replacing a pre-defined character pattern (such as HASH and doing a window.__RUNTIME_CONFIG__.variableName.replace(/HASH/g, '#') ) if someone truly needs that functionality

@seanblonien seanblonien changed the title Added functionality to ignore .env # comments and EOL whitespace Added functionality to ignore .env # comments, trim EOL whitespace, detect different EOL terminators Aug 17, 2021
@seanblonien
Copy link
Contributor Author

@kHRISl33t any more feedback on this?

@kHRISl33t
Copy link
Owner

kHRISl33t commented Aug 23, 2021

@seanblonien will merge it later today (in a few hours), I just need to finish the docs for it :)
Sorry, I have been swamped with work in the last few days.

@kHRISl33t kHRISl33t merged commit 46c61b5 into kHRISl33t:master Aug 23, 2021
@seanblonien seanblonien deleted the ignore-coments branch July 28, 2022 03:02
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.

None yet

2 participants