From caecb14ded9009713cffccdd37710c8555d284bc Mon Sep 17 00:00:00 2001 From: Greg Haygood Date: Wed, 25 Nov 2020 18:31:59 -0500 Subject: [PATCH] 522: ignore empty lines and comments (#531) --- ios/ReactNativeConfig/ReadDotEnv.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ios/ReactNativeConfig/ReadDotEnv.rb b/ios/ReactNativeConfig/ReadDotEnv.rb index f8b7b85..6f80914 100755 --- a/ios/ReactNativeConfig/ReadDotEnv.rb +++ b/ios/ReactNativeConfig/ReadDotEnv.rb @@ -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