Make win-x86 Skia patch idempotent

This commit is contained in:
greepar committed 2026-07-23 16:21:12 +08:00
1 parent c453e1686f
commit cc78c8775d
1 file changed
+3
@@ -363,6 +363,9 @@ function Patch-WinX86SkiaLinker($SkiaDir) {
$pattern = '(?m)^ skjson::ObjectValue\* a = nullptr;\r?\n auto r = \(\*a\)\["tmp"\]\.getType\(\);\r?$'
$patched = [regex]::Replace($text, $pattern, ' int r = 0;')
if ($patched -eq $text) {
if ($text -match '(?m)^ int r = 0;\r?$') {
return
}
throw "Unable to patch win-x86 sk_linker JSON keep-alive references."
}
Set-Content -Path $linkerPath -Value $patched -NoNewline -Encoding UTF8