frontend: Fix chbase.sh using new version of svelte

This commit is contained in:
nemunaire 2022-06-10 18:54:45 +02:00
parent 9f45f10775
commit d69c062d40
3 changed files with 17 additions and 18 deletions

View file

@ -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
}