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:
Pedro Belo 2017-04-26 15:29:56 -07:00
parent e4876b75df
commit d673000a0a
1 changed files with 1 additions and 1 deletions

View File

@ -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|