Created
August 17, 2020 15:18
-
-
Save blech75/f2fea651da96c2194a249340800eabf3 to your computer and use it in GitHub Desktop.
gaedev: pass env vars from .env to dev_appserver.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gaedev() { | |
env_vars_args="" | |
if [ -f '.env' ]; then | |
echo "> Using .env file:" | |
# indent the env to look nicer | |
perl -pe's/^/ /' <.env | |
echo | |
env_vars_args=$(perl -pe's/^(export )?/--env_var /' <.env | perl -pe's/\n/ /') | |
else | |
echo "> No .env file found." | |
echo | |
fi | |
cmd="dev_appserver.py . --enable_console --log_level=debug --storage_path=/tmp/dev_appserver.$(basename $(pwd)) ${env_vars_args} $*" | |
echo "${cmd}" | |
echo | |
$cmd | |
} | |
export -f gaedev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment