Refactor SPA check.
Some checks failed
Lint Checks / Run linter (pull_request) Has been cancelled
Deploy Test / Run deploy test suite (pull_request) Has been cancelled
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Has been cancelled
Webapp Test / Run webapp test suite (pull_request) Has been cancelled
Smoke Test / Run basic test suite (pull_request) Has been cancelled

This commit is contained in:
Thomas E Lackey 2024-05-22 14:00:05 -05:00
parent 579b402f2f
commit 59c69afc0c

View File

@ -8,11 +8,13 @@ CERC_WEBAPP_FILES_DIR="${CERC_WEBAPP_FILES_DIR:-/data}"
CERC_ENABLE_CORS="${CERC_ENABLE_CORS:-false}" CERC_ENABLE_CORS="${CERC_ENABLE_CORS:-false}"
CERC_SINGLE_PAGE_APP="${CERC_SINGLE_PAGE_APP}" CERC_SINGLE_PAGE_APP="${CERC_SINGLE_PAGE_APP}"
if [ -z "${CERC_SINGLE_PAGE_APP}" ] && [ 1 -eq $(find "${CERC_WEBAPP_FILES_DIR}" -name '*.html' | wc -l) ]; then if [ -z "${CERC_SINGLE_PAGE_APP}" ]; then
# If there only one HTML file, we assume an SPA. # If there is only one HTML file, assume an SPA.
CERC_SINGLE_PAGE_APP=true if [ 1 -eq $(find "${CERC_WEBAPP_FILES_DIR}" -name '*.html' | wc -l) ]; then
else CERC_SINGLE_PAGE_APP=true
CERC_SINGLE_PAGE_APP=false else
CERC_SINGLE_PAGE_APP=false
fi
fi fi
# ${var,,} is a lower-case comparison # ${var,,} is a lower-case comparison