remove unused patch label
This commit is contained in:
+4
-3
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user