Fix run_docker to not ignore PYODIDE_SYSTEM_PORT (#1807)

This commit is contained in:
Gyeongjae Choi 2021-08-28 16:03:24 +09:00 committed by GitHub
parent db965b8a32
commit 4f2a9906c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -73,8 +73,9 @@ do
fi
if [[ -n ${PYODIDE_SYSTEM_PORT} ]]; then
echo "WARNING: will use the env var PYODIDE_SYSTEM_PORT=${PYODIDE_SYSTEM_PORT} instead of the provided port"
else
PYODIDE_SYSTEM_PORT=$2
fi
DEFAULT_PYODIDE_SYSTEM_PORT=$2
shift 2
;;
--non-interactive)
@ -101,12 +102,12 @@ PYODIDE_SYSTEM_PORT=${PYODIDE_SYSTEM_PORT:-${DEFAULT_PYODIDE_SYSTEM_PORT}}
PYODIDE_DOCKER_IMAGE=${PYODIDE_DOCKER_IMAGE:-${DEFAULT_PYODIDE_DOCKER_IMAGE}}
# in case the port is not a number, do not bind the port
case $DEFAULT_PYODIDE_SYSTEM_PORT in
case $PYODIDE_SYSTEM_PORT in
none)
PORT_CONFIGURATION_LINE=""
;;
''|*[!0-9]*) # contains a non-digit character, therefore it is not a number
echo "WARNING: Invalid port argument '$DEFAULT_PYODIDE_SYSTEM_PORT'. Port binding disabled."
echo "WARNING: Invalid port argument '$PYODIDE_SYSTEM_PORT'. Port binding disabled."
PORT_CONFIGURATION_LINE=""
;;
*)