react-native-dotenv icon indicating copy to clipboard operation
react-native-dotenv copied to clipboard

only replace `process.env` variable if value is defined

Open schiller-manuel opened this issue 3 years ago • 4 comments

This fixes https://github.com/goatandsheep/react-native-dotenv/issues/251#issuecomment-1066200376

react-native sets the NODE_ENV after this transformation happens. Code that directly access process.env.NODE_ENV was replaced by babelMode during transformation (if latest babel was used) or by undefined.

With this commit, any access to a process.env variable is only replaced by the corresponding value if its value is set.

schiller-manuel avatar May 02 '22 21:05 schiller-manuel

Codecov Report

Base: 98.97% // Head: 98.96% // Decreases project coverage by -0.01% :warning:

Coverage data is based on head (9f3cffd) compared to base (3a940cb). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #316      +/-   ##
==========================================
- Coverage   98.97%   98.96%   -0.02%     
==========================================
  Files           1        1              
  Lines          98       97       -1     
==========================================
- Hits           97       96       -1     
  Misses          1        1              
Impacted Files Coverage Δ
index.js 98.96% <100.00%> (-0.02%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Jun 07 '22 10:06 codecov[bot]

@goatandsheep can this be merged?

schiller-manuel avatar Jun 07 '22 10:06 schiller-manuel

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 10 '22 06:08 stale[bot]

Hi @schiller-manuel let me look into this

goatandsheep avatar Sep 14 '22 23:09 goatandsheep

I will still need to resolve another issue before I release the next version but I'll merge

goatandsheep avatar Oct 12 '22 17:10 goatandsheep