fix(build): better way to process path

This commit is contained in:
Matthieu Bessat 2022-08-02 22:36:41 +02:00
parent 38e90211e7
commit 30d9dc1eef

View file

@ -71,7 +71,8 @@ done
# attempt to do with pipe failed, so I use a non optimal for loop # attempt to do with pipe failed, so I use a non optimal for loop
# find ./ -name "*.html" -exec sh -c 'sed -E -i "s/data-lang-switch=\"([a-z]{2})\".+href\=\".*\"/href\=\"\/\1\/{}\"/g" {}' \; # find ./ -name "*.html" -exec sh -c 'sed -E -i "s/data-lang-switch=\"([a-z]{2})\".+href\=\".*\"/href\=\"\/\1\/{}\"/g" {}' \;
for path in $(find ./build -name "*.html"); do for path in $(find ./build -name "*.html"); do
pathM=`echo $path | cut -c 6-` pathM=`echo $path | sed -E 's%./build/.{2,3}/%%g'`
sed -E -i "s%data-lang-switch=\"([a-z]{2})\".+href\=\".*\"%href\=\"/\1/$pathM\"%g" $path sed -E -i "s%data-lang-switch=\"([a-z]{2})\".+href\=\".*\"%href\=\"/\1/$pathM\"%g" $path
done done