diff --git a/ios/ReactNativeConfig/ReadDotEnv.rb b/ios/ReactNativeConfig/ReadDotEnv.rb index 6f809140..305b4dc4 100755 --- a/ios/ReactNativeConfig/ReadDotEnv.rb +++ b/ios/ReactNativeConfig/ReadDotEnv.rb @@ -48,7 +48,10 @@ def read_dot_env(envs_root) abort('Invalid entry in .env file. Please verify your .env file is correctly formatted.') end - key = m[:key] + # Skip if m[:key] starts with "ANDROID_" + next h if m[:key].start_with?("ANDROID_") + # Strip IOS_ prefix if exists + key = m[:key].sub(/^IOS_/, '') # Ensure string (in case of empty value) and escape any quotes present in the value. val = m[:val].to_s.gsub('"', '\"') h.merge(key => val)