keep quotes around the value optional for now
see: https://github.com/luggit/react-native-config/pull/98#issuecomment-297559873
This commit is contained in:
parent
e4876b75df
commit
d673000a0a
|
@ -15,7 +15,7 @@ puts "Reading env from #{file}"
|
|||
|
||||
dotenv = begin
|
||||
# https://regex101.com/r/SLdbes/1
|
||||
dotenv_pattern = /^(?<key>[[:upper:]_]+)=((?<quote>["'])(?<val>.*?[^\\])\k<quote>|)$/
|
||||
dotenv_pattern = /^(?<key>[[:upper:]_]+)=((?<quote>["'])?(?<val>.*?[^\\])\k<quote>?|)$/
|
||||
# find that above node_modules/react-native-config/ios/
|
||||
raw = File.read(File.join(Dir.pwd, "../../../#{file}"))
|
||||
raw.split("\n").inject({}) do |h, line|
|
||||
|
|
Loading…
Reference in New Issue