fix(build): better way to process path
This commit is contained in:
parent
38e90211e7
commit
30d9dc1eef
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue