rebar3 服务器

This commit is contained in:
lwt
2026-05-19 11:30:21 +08:00
parent aeb18acee0
commit 03fd2da480
5187 changed files with 3670646 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
$ErrorActionPreference = 'Stop'
$root = 'apps/game_server/src/behavior_tree'
$changed = 0
Get-ChildItem $root -Recurse -Filter *.erl | ForEach-Object {
$path = $_.FullName
$text = [IO.File]::ReadAllText($path)
if ($text -notmatch '-include\("bt_game\.hrl"\)\.' -and
($text -match '\btree_node\(\)' -or $text -match '#tree_node\{' -or $text -match '\bblackboard\(\)' -or $text -match '\bbt_status\(\)')) {
$rx = [regex]::new('(^-module\([^)]+\)\.\s*)', [Text.RegularExpressions.RegexOptions]::Multiline)
$new = $rx.Replace($text, "`$1`r`n-include(`"bt_game.hrl`").`r`n", 1)
if ($new -ne $text) {
if ($_.IsReadOnly) { $_.IsReadOnly = $false }
[IO.File]::WriteAllText($path, $new)
$changed++
}
}
}
"changed_files=$changed"