diff --git a/configs/nginx-chbase.sh b/configs/nginx-chbase.sh index 7030f2ea..b993657f 100755 --- a/configs/nginx-chbase.sh +++ b/configs/nginx-chbase.sh @@ -12,22 +12,18 @@ run() { if [ -d "${FILE}" ] then - for f in "${FILE}/"*.html "${FILE}/"*.js "${FILE}/"*.css + for f in "${FILE}/"* do - run "${NEWBASE}" "${f}" + case "${f}" in + "${FILE}/"*.html|"${FILE}/"*.js|"${FILE}/"*.css) + run "${NEWBASE}" "${f}";; + *) + [ -d "${f}" ] && run "${NEWBASE}" "${f}";; + esac done - [ -d "${FILE}/js/" ] && run "${NEWBASE}" "${FILE}/js" - [ -d "${FILE}/views/" ] && run "${NEWBASE}" "${FILE}/views" - [ -d "${FILE}/_app/" ] && run "${NEWBASE}" "${FILE}/_app" - [ -d "${FILE}/_app/assets/pages/" ] && run "${NEWBASE}" "${FILE}/_app/assets/pages" elif [ -f "${FILE}" ] then - if [ "${FILE##*.}" == "css" ] - then - sed -ri "s@${CURRENT_BASE}_app/@${NEWBASE}_app/@g" ${FILE} - else - sed -ri "s@(href|src)=\"${CURRENT_BASE}@\1=\"${NEWBASE}@g;s@\\\$http.get\(\"${CURRENT_BASE}@\$http.get\(\"${NEWBASE}@g;s@\\\$http\((.*)\"${CURRENT_BASE}@\$http(\1\"${NEWBASE}@g;s@\"${CURRENT_BASE}_app@\"${NEWBASE}_app@g;s@\`${CURRENT_BASE}_app/\\\$@\`${NEWBASE}_app/\\\$@g;s@paths: \{\"base\":\"${CURRENT_BASE%/}\",\"assets\":\"${CURRENT_BASE%/}\"\},@paths: {\"base\":\"${NEWBASE%/}\",\"assets\":\"${NEWBASE%/}\"},@" ${FILE} - fi + sed -ri "s@(href|src)=\"${CURRENT_BASE}@\1=\"${NEWBASE}@g;s@\\\$http.get\(\"${CURRENT_BASE}@\$http.get\(\"${NEWBASE}@g;s@\\\$http\((.*)\"${CURRENT_BASE}@\$http(\1\"${NEWBASE}@g;s@\"${CURRENT_BASE}_app/immutable/@\"${NEWBASE}_app/immutable/@g;s@^(\s+)paths: \{\"base\":\s*\"[^\"]*\",\"assets\":\s*\"[^\"]*\"\},\$@\1paths: {\"base\":\"${NEWBASE%/}\",\"assets\":\"${NEWBASE%/}\"},@;s@url\(${CURRENT_BASE}_app/immutable/@url(${NEWBASE}_app/immutable/@g" ${FILE} fi } diff --git a/entrypoint-frontend.sh b/entrypoint-frontend.sh index 9de9f175..1e08e687 100755 --- a/entrypoint-frontend.sh +++ b/entrypoint-frontend.sh @@ -10,15 +10,18 @@ run() { if [ -d "${FILE}" ] then - for f in "${FILE}/"*.html "${FILE}/"*.js + for f in "${FILE}/"* do - run "${NEWBASE}" "${f}" + case "${f}" in + "${FILE}/"*.html|"${FILE}/"*.js) + run "${NEWBASE}" "${f}";; + *) + [ -d "${f}" ] && run "${NEWBASE}" "${f}";; + esac done - [ -d "${FILE}/js/" ] && run "${NEWBASE}" "${FILE}/js" - [ -d "${FILE}/views/" ] && run "${NEWBASE}" "${FILE}/views" elif [ -f "${FILE}" ] then - sed -ri "s@(href|src)=\"${CURRENT_BASE}@\1=\"${NEWBASE}@g;s@\\\$http.get\(\"${CURRENT_BASE}@\$http.get\(\"${NEWBASE}@g;s@\\\$http\((.*)\"${CURRENT_BASE}@\$http(\1\"${NEWBASE}@g" ${FILE} + sed -ri "s@(href|src)=\"${CURRENT_BASE}@\1=\"${NEWBASE}@g;s@\\\$http.get\(\"${CURRENT_BASE}@\$http.get\(\"${NEWBASE}@g;s@\\\$http\((.*)\"${CURRENT_BASE}@\$http(\1\"${NEWBASE}@g;s@\"${CURRENT_BASE}_app/immutable/@\"${NEWBASE}_app/immutable/@g" ${FILE} fi } diff --git a/frontend/ui/svelte.config.js b/frontend/ui/svelte.config.js index 55fe534b..90e1ca8b 100644 --- a/frontend/ui/svelte.config.js +++ b/frontend/ui/svelte.config.js @@ -7,7 +7,7 @@ const config = { fallback: 'index.html' }), paths: { - // base: '/2021', + // base: '/2022', }, } };