Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ignore empty lines and comments in env files #531

Merged
merged 1 commit into from
Nov 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ios/ReactNativeConfig/ReadDotEnv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def read_dot_env(envs_root)
raw.split("\n").inject({}) do |h, line|
m = line.match(dotenv_pattern)

next h if line.nil? || line.strip.empty?
next h if line.match(/^\s*#/)

if m.nil?
abort('Invalid entry in .env file. Please verify your .env file is correctly formatted.')
end
Expand Down