修复小程序wxapi 的依赖全部改成 api

This commit is contained in:
2026-04-14 08:31:24 +08:00
parent bcf46d0fda
commit fcb61618b8
167 changed files with 27683 additions and 27521 deletions

View File

@@ -0,0 +1,39 @@
#!/usr/bin/env pwsh
# fix-lf.ps1 — 检查并修复 game-docker 中关键文件的行尾符CRLF → LF
# 在上传部署前运行,确保 shell 脚本等文件在 Linux 容器中可正常执行
$root = $PSScriptRoot
$patterns = @('*.sh', '*.conf', '*.env', 'Dockerfile', 'deploy.sh', 'init-ssl.sh',
'docker-compose*.yml', '*.yaml', 'entrypoint*')
Write-Host "扫描目录: $root" -ForegroundColor Cyan
Write-Host ""
$files = $patterns | ForEach-Object {
Get-ChildItem -Path $root -Recurse -Filter $_ -File
} | Sort-Object FullName -Unique
$crlfFiles = $files | Where-Object {
$bytes = [System.IO.File]::ReadAllBytes($_.FullName)
($bytes | Where-Object { $_ -eq 13 } | Measure-Object).Count -gt 0
}
if (-not $crlfFiles) {
Write-Host "✓ 所有关键文件行尾符正常LF无需修复。" -ForegroundColor Green
exit 0
}
Write-Host "发现 $($crlfFiles.Count) 个文件含 CRLF正在修复..." -ForegroundColor Yellow
Write-Host ""
foreach ($f in $crlfFiles) {
$content = [System.IO.File]::ReadAllText($f.FullName)
$fixed = $content -replace "`r`n", "`n"
[System.IO.File]::WriteAllText($f.FullName, $fixed, [System.Text.UTF8Encoding]::new($false))
$rel = $f.FullName.Substring($root.Length + 1)
Write-Host " 已修复: $rel" -ForegroundColor Green
}
Write-Host ""
Write-Host "✓ 修复完成,共处理 $($crlfFiles.Count) 个文件。" -ForegroundColor Green