Skip to content

Commit

Permalink
fix env script
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Lauber <jan.lauber@protonmail.ch>
  • Loading branch information
janlauber committed Jan 30, 2022
1 parent 2f3f6bf commit 2b5d40d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/src/MockAPI
/src/MockAPI

*.yaml
env-config.js
5 changes: 0 additions & 5 deletions env-config.js

This file was deleted.

18 changes: 15 additions & 3 deletions env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,22 @@ if [ -f .env ]; then
done < .env
fi

if [ -z "$API_URL" ]; then
echo " API_URL: \"http://localhost:8080\"," >> ./env-config.js
if [ -z "$REACT_APP_CLIENT_ID" ]; then
echo " REACT_APP_CLIENT_ID: \"<token>\"," >> ./env-config.js
else
echo " API_URL: \"$API_URL\"," >> ./env-config.js
echo " REACT_APP_CLIENT_ID: \"$REACT_APP_CLIENT_ID\"," >> ./env-config.js
fi

if [ -z "$REACT_APP_REDIRECT_URI" ]; then
echo " REACT_APP_REDIRECT_URI: \"http://localhost:8080\"," >> ./env-config.js
else
echo " REACT_APP_REDIRECT_URI: \"$REACT_APP_REDIRECT_URI\"," >> ./env-config.js
fi

if [ -z "$REACT_APP_API_OAUTH_URI" ]; then
echo " REACT_APP_API_OAUTH_URI: \"http://localhost:8080\"," >> ./env-config.js
else
echo " REACT_APP_API_OAUTH_URI: \"$REACT_APP_API_OAUTH_URI\"," >> ./env-config.js
fi

echo "}" >> ./env-config.js

0 comments on commit 2b5d40d

Please sign in to comment.