From 7797395e977e4ef965c84378613c87b9cfb3cd85 Mon Sep 17 00:00:00 2001 From: Kodie Date: Wed, 16 Oct 2024 05:03:01 +1300 Subject: [PATCH] fix: replace bash pattern replacement with sed (#185) --- website/copy-api.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/copy-api.sh b/website/copy-api.sh index 838c9b83..8a9bbdf7 100755 --- a/website/copy-api.sh +++ b/website/copy-api.sh @@ -56,8 +56,8 @@ process_subpackage() { local title="$(kebab_to_title_case "$pkg_name")" fi - escaped_name="${name//@/\\@}" - escaped_name="${escaped_name//\//\\/}" + escaped_name=$(echo "$name" | sed 's/@/\\@/g') + escaped_name=$(echo "$escaped_name" | sed 's/\//\\/g') sed -i -e "s/title: \(.*\)/title: \"$escaped_name\"/" "$dir/index.mdx" sed -i -e "s/## Index/ /" "$dir/index.mdx" echo "{ \"title\": \"$title\" }" >"$dir/meta.json"