more
This commit is contained in:
+6
-3
@@ -8,6 +8,7 @@ ForEach-Object {
|
|||||||
# Read entire file as one string
|
# Read entire file as one string
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
$content = Get-Content -Path $_.FullName -Raw
|
$content = Get-Content -Path $_.FullName -Raw
|
||||||
|
$new = $content
|
||||||
|
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
# Regex pattern (PowerShell-safe)
|
# Regex pattern (PowerShell-safe)
|
||||||
@@ -72,7 +73,7 @@ $($eventScript)Rematch::
|
|||||||
trainerbattle_rematch_double $trainer, $introText, $defeatText, $notenoughmons
|
trainerbattle_rematch_double $trainer, $introText, $defeatText, $notenoughmons
|
||||||
msgbox $postbattle, $messagebox
|
msgbox $postbattle, $messagebox
|
||||||
end"
|
end"
|
||||||
|
|
||||||
$content = $content -replace [regex]::Escape($item), $replacement
|
$content = $content -replace [regex]::Escape($item), $replacement
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,6 +82,8 @@ $($eventScript)Rematch::
|
|||||||
# ----------------------------
|
# ----------------------------
|
||||||
# Write back to file
|
# 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)"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user