mirror of
https://github.com/status-im/react-native-config.git
synced 2025-02-24 04:48:16 +00:00
Merge pull request #48 from cooperka/master
Fix inconsistency in file path when using /tmp/envfile
This commit is contained in:
commit
a300296954
@ -8,14 +8,14 @@ if File.exists?("/tmp/envfile")
|
|||||||
file = File.read("/tmp/envfile").strip
|
file = File.read("/tmp/envfile").strip
|
||||||
else
|
else
|
||||||
custom_env = false
|
custom_env = false
|
||||||
file = File.join(Dir.pwd, "../../../.env")
|
file = ".env"
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "Reading env from #{file}"
|
puts "Reading env from #{file}"
|
||||||
|
|
||||||
dotenv = begin
|
dotenv = begin
|
||||||
# find that above node_modules/react-native-config/ios/
|
# find that above node_modules/react-native-config/ios/
|
||||||
raw = File.read(file)
|
raw = File.read(File.join(Dir.pwd, "../../../#{file}"))
|
||||||
raw.split("\n").inject({}) do |h, line|
|
raw.split("\n").inject({}) do |h, line|
|
||||||
key, val = line.split("=", 2)
|
key, val = line.split("=", 2)
|
||||||
if line.strip.empty? or line.start_with?('#')
|
if line.strip.empty? or line.start_with?('#')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user