522: ignore empty lines and comments (#531)

This commit is contained in:
Greg Haygood
2020-11-25 20:31:59 -03:00
committed by GitHub
parent 9fa6ddcee8
commit caecb14ded
+3
View File
@@ -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