整理内容: - 删除 60+ 临时测试输出文件 (*.txt) - 移动二进制文件到 bin/ 目录 - 移动 Shell 脚本到 scripts/ 目录 - scripts/dev/: check_gitea.sh, check_sub2api.sh, run_tests.sh - scripts/deploy/: deploy_*.sh, simple_deploy.sh - scripts/ops/: fix_nginx.sh, fix_ssl.sh, install_docker.sh - scripts/test/: test_*.sh, test_*.bat - 移动批处理文件到 scripts/ - 移动 Python 脚本到 tools/ - 清理临时日志文件 保留根目录必要文件: - go.mod, go.sum, go.work - Makefile, docker-compose.yml - .env.example, .gitignore - README.md, AGENTS.md, DEPLOY_GUIDE.md 验证: go build ./... && go test ./... 通过
62 lines
2.3 KiB
PowerShell
62 lines
2.3 KiB
PowerShell
# 项目迁移快速检查脚本
|
||
Write-Host "====================================" -ForegroundColor Cyan
|
||
Write-Host "项目迁移快速检查" -ForegroundColor Cyan
|
||
Write-Host "====================================" -ForegroundColor Cyan
|
||
Write-Host ""
|
||
|
||
# 1. 检查关键文件
|
||
Write-Host "1. 检查关键文件..." -ForegroundColor Yellow
|
||
$files = @("go.mod", "README.md", "cmd\server\main.go", "configs\config.yaml")
|
||
foreach ($file in $files) {
|
||
$path = "D:\project\$file"
|
||
$status = if (Test-Path $path) { "✅" } else { "❌" }
|
||
Write-Host " $status $file"
|
||
}
|
||
Write-Host ""
|
||
|
||
# 2. 检查Go环境
|
||
Write-Host "2. 检查Go环境..." -ForegroundColor Yellow
|
||
try {
|
||
$goVersion = go version 2>&1
|
||
if ($LASTEXITCODE -eq 0) {
|
||
Write-Host " ✅ Go已安装: $goVersion"
|
||
} else {
|
||
Write-Host " ❌ Go未安装"
|
||
}
|
||
} catch {
|
||
Write-Host " ❌ Go未安装"
|
||
}
|
||
Write-Host ""
|
||
|
||
# 3. 统计文件
|
||
Write-Host "3. 统计文件..." -ForegroundColor Yellow
|
||
$fileCount = (Get-ChildItem -Path D:\project -Recurse -File -ErrorAction SilentlyContinue | Measure-Object).Count
|
||
Write-Host " 文件数: $fileCount"
|
||
Write-Host ""
|
||
|
||
# 4. 计算大小
|
||
Write-Host "4. 计算大小..." -ForegroundColor Yellow
|
||
$size = [math]::Round((Get-ChildItem -Path D:\project -Recurse -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum).Sum / 1MB, 2)
|
||
Write-Host " 总大小: ${size} MB"
|
||
Write-Host ""
|
||
|
||
# 5. 检查目录结构
|
||
Write-Host "5. 检查目录结构..." -ForegroundColor Yellow
|
||
$dirs = @("cmd", "internal", "configs", "docs", "migrations", "deployment")
|
||
foreach ($dir in $dirs) {
|
||
$path = "D:\project\$dir"
|
||
$status = if (Test-Path $path -PathType Container) { "✅" } else { "❌" }
|
||
Write-Host " $status $dir\"
|
||
}
|
||
Write-Host ""
|
||
|
||
Write-Host "====================================" -ForegroundColor Cyan
|
||
Write-Host "快速检查完成!" -ForegroundColor Green
|
||
Write-Host "====================================" -ForegroundColor Cyan
|
||
Write-Host ""
|
||
Write-Host "下一步:" -ForegroundColor Yellow
|
||
Write-Host "1. 查看完整检查清单: docs\\migration\\MIGRATION_CHECKLIST.md" -ForegroundColor White
|
||
Write-Host "2. 查看下一步操作: docs\\plans\\NEXT_STEPS.md" -ForegroundColor White
|
||
Write-Host "3. 如果Go已安装,运行: go build ./cmd/server" -ForegroundColor White
|
||
Write-Host ""
|