ui: Fix base url mess
This commit is contained in:
parent
74d77dce9f
commit
17839474e1
23 changed files with 66 additions and 43 deletions
|
|
@ -10,15 +10,22 @@ run() {
|
|||
|
||||
if [ -d "${FILE}" ]
|
||||
then
|
||||
for f in "${FILE}/"*.html "${FILE}/"*.js
|
||||
for f in "${FILE}/"*.html "${FILE}/"*.js "${FILE}/"*.css
|
||||
do
|
||||
run "${NEWBASE}" "${f}"
|
||||
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
|
||||
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}
|
||||
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@from \"${CURRENT_BASE}_app@from \"${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
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue