From 30d9dc1eefa09073f497e62849a95ced9dd16b86 Mon Sep 17 00:00:00 2001 From: Matthieu Bessat Date: Tue, 2 Aug 2022 22:36:41 +0200 Subject: [PATCH] fix(build): better way to process path --- build_tools/static_build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build_tools/static_build.sh b/build_tools/static_build.sh index e033879..c59be16 100755 --- a/build_tools/static_build.sh +++ b/build_tools/static_build.sh @@ -71,7 +71,8 @@ done # 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" {}' \; 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 done