fix(scripts): GitHub sanitize rewrites kalinamall doc URLs reliably
This commit is contained in:
@@ -152,4 +152,18 @@ if (Test-Path -LiteralPath $netlogonDoc) {
|
||||
Set-TrackedFileText -RelativePath 'Docs/deploy-netlogon-publish.md' -Content $doc
|
||||
}
|
||||
|
||||
$mdFiles = @(git ls-files '*.md' 2>$null | Where-Object { $_ -and (Test-Path $_) })
|
||||
foreach ($rel in $mdFiles) {
|
||||
$path = Join-Path $Root $rel
|
||||
$md = Get-Content -LiteralPath $path -Raw
|
||||
$orig = $md
|
||||
$md = $md -replace 'https://git\.kalinamall\.ru/PapaTramp/([^)/\s]+)/src/branch/main/', 'https://github.com/PTah/$1/blob/main/'
|
||||
$md = $md -replace 'https://git\.papatramp\.ru/PapaTramp/([^)/\s]+)/src/branch/main/', 'https://github.com/PTah/$1/blob/main/'
|
||||
$md = $md -replace 'https://git\.kalinamall\.ru/PapaTramp/', 'https://github.com/PTah/'
|
||||
$md = $md -replace 'https://git\.papatramp\.ru/PapaTramp/', 'https://github.com/PTah/'
|
||||
if ($md -ne $orig) {
|
||||
Set-TrackedFileText -RelativePath $rel -Content $md
|
||||
}
|
||||
}
|
||||
|
||||
Write-Output 'Sanitize-ForGitHub: done'
|
||||
|
||||
Reference in New Issue
Block a user