2018-12-05 20:46:36 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Creates an .env from ENV variables for use with react-native-config
|
2018-12-06 12:16:08 +03:00
|
|
|
printf "Old .env file:\n"
|
|
|
|
cat .env
|
|
|
|
printf "Started script:\n"
|
2018-12-27 13:55:51 +03:00
|
|
|
ENV_WHITELIST=${ENV_WHITELIST:-"/ACTIVITY|WEBSOCKET|BACKEND|API|TOKEN|PIN|URL/"}
|
2018-12-05 20:46:36 +03:00
|
|
|
printf "Creating an .env file with the following whitelist:\n"
|
|
|
|
printf "%s\n\n" $ENV_WHITELIST
|
2018-12-06 12:37:27 +03:00
|
|
|
set | egrep -e $ENV_WHITELIST | egrep -v "^_" | egrep -v "WHITELIST" | egrep -v "USER-DEFINED" > .env
|
2018-12-05 20:46:36 +03:00
|
|
|
printf "\n.env created with contents:\n"
|
2018-12-06 12:05:37 +03:00
|
|
|
cat .env
|
|
|
|
printf "\nEND OF .env\n"
|