frontend: Fix chbase.sh using new version of svelte
This commit is contained in:
parent
9f45f10775
commit
d69c062d40
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ const config = {
|
||||
fallback: 'index.html'
|
||||
}),
|
||||
paths: {
|
||||
// base: '/2021',
|
||||
// base: '/2022',
|
||||
},
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user