Files
user-system/quick_check.ps1

62 lines
2.3 KiB
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 项目迁移快速检查脚本
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 ""