From f541c35a584e6ab6ebed3f215a32fd7232dd665b Mon Sep 17 00:00:00 2001 From: dionmoustos Date: Tue, 2 Jun 2026 20:01:08 +0930 Subject: [PATCH] more --- add_rematcges.ps1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/add_rematcges.ps1 b/add_rematcges.ps1 index 9dd02ed7f..804a6d5ea 100644 --- a/add_rematcges.ps1 +++ b/add_rematcges.ps1 @@ -8,6 +8,7 @@ ForEach-Object { # Read entire file as one string # ---------------------------- $content = Get-Content -Path $_.FullName -Raw + $new = $content # ---------------------------- # Regex pattern (PowerShell-safe) @@ -72,7 +73,7 @@ $($eventScript)Rematch:: trainerbattle_rematch_double $trainer, $introText, $defeatText, $notenoughmons msgbox $postbattle, $messagebox end" - + $content = $content -replace [regex]::Escape($item), $replacement } @@ -81,6 +82,8 @@ $($eventScript)Rematch:: # ---------------------------- # Write back to file # ---------------------------- - Set-Content -Path $_.FullName -Value $content.Trim() - + if($new -ne $content) { + Set-Content -Path $_.FullName -Value $content + Write-Host "Updated: $($_.FullName)" + } }