mirror of
https://gitlab.com/octtspacc/sitoctt
synced 2025-06-05 22:09:20 +02:00
.
This commit is contained in:
12
Scripts/Redirects.sh
Executable file
12
Scripts/Redirects.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$(realpath "$0")")/Lib/Globals.sh"
|
||||
cd "${swd}/.."
|
||||
|
||||
cd ./build/public
|
||||
find . -type f -name index.html -exec sh -c '
|
||||
nicepath="$(echo "{}" | rev | cut -d/ -f2- | rev)"
|
||||
niceurl="./$(echo "${nicepath}" | rev | cut -d/ -f1 | rev)/"
|
||||
sed -e "s|{URL}|${niceurl}|g" ../../redirectTemplate.html > "${nicepath}.html"
|
||||
' \;
|
||||
|
||||
cd "${owd}"
|
Reference in New Issue
Block a user