chore: 强制提交dist命令

This commit is contained in:
lzh
2025-12-23 13:53:31 +08:00
parent 2b238136ad
commit 3c206a831e
3 changed files with 24 additions and 11 deletions

View File

@@ -28,7 +28,14 @@ Write-Host "🔨 Building project..." -ForegroundColor Yellow
pnpm build:antd
# 5. 检查构建结果
if (-not (Test-Path "apps\web-antd\dist") -or ((Get-ChildItem "apps\web-antd\dist" -ErrorAction SilentlyContinue).Count -eq 0)) {
$distPath = "apps\web-antd\dist"
if (-not (Test-Path $distPath)) {
Write-Host "❌ Error: Build failed, dist directory not found" -ForegroundColor Red
exit 1
}
$distItems = Get-ChildItem $distPath -ErrorAction SilentlyContinue
if ($null -eq $distItems -or $distItems.Count -eq 0) {
Write-Host "❌ Error: Build failed, dist directory is empty" -ForegroundColor Red
exit 1
}
@@ -46,7 +53,8 @@ if ($response -eq "y" -or $response -eq "Y") {
$gitStatus = git status --porcelain
if ($gitStatus) {
Write-Host "📝 Staging build artifacts..." -ForegroundColor Yellow
git add apps/web-antd/dist
# 使用 -f 强制添加被 .gitignore 忽略的 dist 目录
git add -f apps/web-antd/dist
git add -A # 添加其他更改
Write-Host "💾 Committing changes..." -ForegroundColor Yellow