Skip to content

Commit

Permalink
Update ReadDotEnv.rb
Browse files Browse the repository at this point in the history
Fix to allow spaces in .env file
  • Loading branch information
danielwinkler authored and luancurti committed Apr 24, 2020
1 parent b1e1876 commit 2318d80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/ReactNativeConfig/ReadDotEnv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def read_dot_env(envs_root)

dotenv = begin
# https://regex101.com/r/cbm5Tp/1
dotenv_pattern = /^(?:export\s+|)(?<key>[[:alnum:]_]+)=((?<quote>["'])?(?<val>.*?[^\\])\k<quote>?|)$/
dotenv_pattern = /^(?:export\s+|)(?<key>[[:alnum:]_]+)\s*=\s*((?<quote>["'])?(?<val>.*?[^\\])\k<quote>?|)$/

path = File.expand_path(File.join(envs_root, file.to_s))
if File.exist?(path)
Expand Down

0 comments on commit 2318d80

Please # to comment.