I am setting up testing environments on a react native app. Recently, my build commands have stopped including the environment variables that I pass into them.
EMAIL=testemail@test.com PASSWORD=testpassword xcodebuild....
When the app runs, process.env.EMAIL returns undefined and if I log the process.env object the EMAIL, PASSWORD, or any other variable provided in the command line is not listed.
UPDATE: This really seems to be an issue with detox/metro. This is where the passed-in environment variables should be received as is outlined in Detox's docs regarding mocking, which is also broken now.
Any ideas on what I changed that broke this functionality?
I figured it out. I recently modified my bash script to read the variable values, and have them then passed in on the build call. Turns out, those need to be passed in when I call the script itself. So I solved the issue by nesting the script inside of another that reads the variables and then passes them in appropriately.
Any explanation as to why this script nesting works and not a single script would definitely be appreciated.