From fef7649683eb41dab66513ec4878a5f6161c54cc Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Wed, 22 May 2024 19:00:42 +0000 Subject: [PATCH] Refactor SPA check. (#831) Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/831 Co-authored-by: Thomas E Lackey Co-committed-by: Thomas E Lackey --- .../cerc-webapp-base/scripts/start-serving-app.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/stack_orchestrator/data/container-build/cerc-webapp-base/scripts/start-serving-app.sh b/stack_orchestrator/data/container-build/cerc-webapp-base/scripts/start-serving-app.sh index 855cfd93..3a114ee0 100755 --- a/stack_orchestrator/data/container-build/cerc-webapp-base/scripts/start-serving-app.sh +++ b/stack_orchestrator/data/container-build/cerc-webapp-base/scripts/start-serving-app.sh @@ -8,11 +8,13 @@ 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. - CERC_SINGLE_PAGE_APP=true -else - CERC_SINGLE_PAGE_APP=false +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