Skip to content

Commit

Permalink
chore: avoid recursive sed
Browse files Browse the repository at this point in the history
  • Loading branch information
wangl-cc committed Aug 4, 2024
1 parent c9c492c commit e78a943
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions maa-cli/docs/gen_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ icons=(
ph:question-fill
)

sed() {
sedi() {
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "$@"
else
Expand Down Expand Up @@ -56,8 +56,8 @@ for lang in en-US zh-CN zh-TW ja-JP ko-KR; do
cat "$file"
} > "$out_file"
# remap some relative links to github links
sed -E 's|\.\./\.\./|https://github.com/MaaAssistantArknights/maa-cli/blob/main/maa-cli/|g' "$out_file"
sedi -E 's|\.\./\.\./|https://github.com/MaaAssistantArknights/maa-cli/blob/main/maa-cli/|g' "$out_file"
# remap maa docs links to the relative links
sed -E 's|https://maa\.plus/docs/[^/]+/(.+)\.html|../../\1.md|g' "$out_file"
sedi -E 's|https://maa\.plus/docs/[^/]+/(.+)\.html|../../\1.md|g' "$out_file"
done
done

0 comments on commit e78a943

Please sign in to comment.