Refactor SPA check. (#831)
Smoke Test / Run basic test suite (push) Failing after 5s Details
Publish / Build and publish (push) Failing after 5s Details
Deploy Test / Run deploy test suite (push) Failing after 4s Details
Webapp Test / Run webapp test suite (push) Failing after 3s Details
Lint Checks / Run linter (push) Failing after 4s Details

Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/831
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
telackey/wagit v1.1.0-fef7649-202405221901
Thomas E Lackey 2024-05-22 19:00:42 +00:00 committed by Thomas E Lackey
parent 579b402f2f
commit fef7649683
1 changed files with 7 additions and 5 deletions

View File

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