Skip to content

Instantly share code, notes, and snippets.

@itcherry
Created June 24, 2021 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itcherry/b71fbb3897f973dc1b79fb803d49b55d to your computer and use it in GitHub Desktop.
Save itcherry/b71fbb3897f973dc1b79fb803d49b55d to your computer and use it in GitHub Desktop.
React Native environment variables generator taken from CI
#!/bin/bash
if [ $1 == 'stage' ]
then
read -d '' env << EOF
API_BASE=/new/api
SOME_YOUR_TOKEN_TOKEN=$SOME_YOUR_TOKEN_STAGE
# Add your tokens here
elif [ $1 == 'prod' ]
then
read -d '' env << EOF
API_BASE=/new/api
SOME_YOUR_TOKEN_TOKEN=$SOME_YOUR_TOKEN_PROD
# Add your tokens here
EOF
fi
echo "$env" > ~/YOUR_REACT_NATIVE_PROJECT_NAME/.env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment