diff --git a/run.sh b/run.sh index bd5d4552d2d3343bac1de7bc5b716f9a447ff703..e08f90493948aaa437f0c8c817b23f9d9bb562b1 100755 --- a/run.sh +++ b/run.sh @@ -34,7 +34,7 @@ echo "[ Docker=$docker ]" # Check for the correct Python version (3.8+) PYTHON_EXEC="python3" -echo "[ Using $(python3 -V) ]" +echo "[ Using $("$PYTHON_EXEC" -V) ]" # +++ DEFAULT COMMANDS +++ # @@ -45,24 +45,24 @@ if [[ $docker == "false" ]]; then if [[ $mode == "dev" ]]; then source python/bin/activate - echo "Running Engine API in Python Environment ($(python3 -V))" + echo "Running Engine API in Python Environment ($("$PYTHON_EXEC" -V))" echo "Starting API Server" - python src/app.py + "$PYTHON_EXEC" src/app.py fi ### Runs the API Server (Test) ### if [[ $mode == "api-test-0" ]]; then echo "Starting API Server 0" - /usr/bin/env python3 src/app.py config=tests/config/engine-0-api.ini + "$PYTHON_EXEC" src/app.py config=tests/config/engine-0-api.ini fi if [[ $mode == "api-test-1" ]]; then echo "Starting API Server 1" - /usr/bin/env python3 src/app.py config=tests/config/engine-1-api.ini + "$PYTHON_EXEC" src/app.py config=tests/config/engine-1-api.ini fi if [[ $mode == "api-test-2" ]]; then echo "Starting API Server 2" - /usr/bin/env python3 src/app.py config=tests/config/engine-2-api.ini + "$PYTHON_EXEC" src/app.py config=tests/config/engine-2-api.ini fi ### Runs the API Server using Gunicorn without a system daemon (Production) ### @@ -80,7 +80,7 @@ if [[ $docker == "false" ]]; then ### CAUTION: This deletes everything in your database ### if [[ $mode == "recreate-database" ]]; then - /usr/bin/env python3 src/app.py --recreate-database + "$PYTHON_EXEC" src/app.py --recreate-database fi fi @@ -117,4 +117,4 @@ if [[ $docker == "true" ]]; then if [[ $mode == "push" ]]; then exec sudo docker push autoradio/engine-api fi -fi \ No newline at end of file +fi