#!/usr/bin/env ruby require "json" # find the project dotenv file above node_modules/react-native-config/ios/ dotenv = File.read(File.join(Dir.pwd, "../../../.env")).split("\n").inject({}) do |h, line| key, val = line.split("=", 2) h.merge!(key => val) end # create obj file that sets DOT_ENV as a NSDictionary dotenv_objc = dotenv.map { |k, v| %Q(@"#{k}":@"#{v}") }.join(",") template = <