remove unused patch label

This commit is contained in:
InkerBot
2026-03-05 13:50:31 +08:00
parent 648aa93360
commit 8d9f52a180
13 changed files with 30 additions and 28 deletions
+4 -3
View File
@@ -29,6 +29,7 @@ function Test-Ignored {
if ($RelPath -like $pattern) { return $true }
} else {
if ((Split-Path -Leaf $RelPath) -like $pattern) { return $true }
if ($RelPath -like "$pattern/*") { return $true }
}
}
return $false
@@ -53,11 +54,11 @@ Get-ChildItem -Path $Core -Recurse -File | Where-Object {
$srcHash = (Get-FileHash $srcFile -Algorithm MD5).Hash
$dstHash = (Get-FileHash $_.FullName -Algorithm MD5).Hash
if ($srcHash -ne $dstHash) {
diff -u $srcFile $_.FullName | Out-File -FilePath $patchFile -Encoding utf8
diff -u --label "a/$rel" --label "b/$rel" $srcFile $_.FullName | Out-File -FilePath $patchFile -Encoding utf8
Write-Host " Modified: $rel"
}
} else {
diff -u /dev/null $_.FullName | Out-File -FilePath $patchFile -Encoding utf8
diff -u --label /dev/null --label "b/$rel" /dev/null $_.FullName | Out-File -FilePath $patchFile -Encoding utf8
Write-Host " New: $rel"
}
}
@@ -74,7 +75,7 @@ Get-ChildItem -Path $SingBox -Recurse -File | Where-Object {
if (-not (Test-Path $dstFile)) {
$patchFileDir = Split-Path -Parent $patchFile
if (-not (Test-Path $patchFileDir)) { New-Item -ItemType Directory -Path $patchFileDir -Force | Out-Null }
diff -u $_.FullName /dev/null | Out-File -FilePath $patchFile -Encoding utf8
diff -u --label "a/$rel" --label /dev/null $_.FullName /dev/null | Out-File -FilePath $patchFile -Encoding utf8
Write-Host " Deleted: $rel"
}
}