From fdbcee3a93000f53b1d3f75f741f85f1d547af54 Mon Sep 17 00:00:00 2001 From: Andreas Abeck Date: Tue, 17 Feb 2026 21:14:12 +0100 Subject: [PATCH] fix according to issue #12045 (#12047) --- docs/contribution/setup-fork.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/contribution/setup-fork.sh b/docs/contribution/setup-fork.sh index f3a1f4f47..a842d7c13 100644 --- a/docs/contribution/setup-fork.sh +++ b/docs/contribution/setup-fork.sh @@ -134,7 +134,7 @@ update_links() { # Find all files containing the old repo reference while IFS= read -r file; do # Count occurrences - local count=$(grep -c "github.com/$old_repo/$old_name" "$file" 2>/dev/null || echo 0) + local count=$(grep -E -c "(github.com|githubusercontent.com)/$old_repo/$old_name" "$file" 2>/dev/null || echo 0) if [[ $count -gt 0 ]]; then # Backup original @@ -143,16 +143,16 @@ update_links() { # Replace links - use different sed syntax for BSD/macOS vs GNU sed if sed --version &>/dev/null 2>&1; then # GNU sed - sed -i "s|github.com/$old_repo/$old_name|github.com/$new_owner/$new_repo|g" "$file" + sed -E -i "s@(github.com|githubusercontent.com)/$old_repo/$old_name@\\1/$new_owner/$new_repo@g" "$file" else # BSD sed (macOS) - sed -i '' "s|github.com/$old_repo/$old_name|github.com/$new_owner/$new_repo|g" "$file" + sed -E -i '' "s@(github.com|githubusercontent.com)/$old_repo/$old_name@\\1/$new_owner/$new_repo@g" "$file" fi ((files_updated++)) print_success "Updated $file ($count links)" fi - done < <(find "$search_path" -type f \( -name "*.md" -o -name "*.sh" -o -name "*.func" -o -name "*.json" \) -not -path "*/.git/*" 2>/dev/null | xargs grep -l "github.com/$old_repo/$old_name" 2>/dev/null) + done < <(find "$search_path" -type f \( -name "*.md" -o -name "*.sh" -o -name "*.func" -o -name "*.json" \) -not -path "*/.git/*" 2>/dev/null | xargs grep -E -l "(github.com|githubusercontent.com)/$old_repo/$old_name" 2>/dev/null) return $files_updated }