mirror of
https://github.com/status-im/react-native-config.git
synced 2025-03-01 07:20:42 +00:00
14 lines
402 B
Ruby
Executable File
14 lines
402 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
require_relative 'ReadDotEnv'
|
|
|
|
envs_root = ARGV[0]
|
|
config_output = ARGV[1]
|
|
puts "reading env file from #{envs_root} and writing .config to #{config_output}"
|
|
|
|
dotenv, custom_env = read_dot_env(envs_root)
|
|
|
|
dotenv_xcconfig = dotenv.map { |k, v| %(#{k}=#{v.gsub(/\/\//, "/$()/")}) }.join("\n")
|
|
File.open(config_output, 'w') { |f| f.puts dotenv_xcconfig }
|