# 风七六本地生活服务平台 - 自动检验并提交脚本 (PowerShell版本) # 使用方法: .\scripts\auto-commit.ps1 Write-Host "=====================================" -ForegroundColor Cyan Write-Host "风七六 - 自动检验和提交流程" -ForegroundColor Cyan Write-Host "=====================================" -ForegroundColor Cyan # 检查是否在git仓库中 try { $null = git rev-parse --git-dir 2>$null if ($LASTEXITCODE -ne 0) { Write-Host "错误: 当前目录不是git仓库" -ForegroundColor Red exit 1 } } catch { Write-Host "错误: 当前目录不是git仓库" -ForegroundColor Red exit 1 } # 检查仓库状态 Write-Host "1. 检查仓库状态..." -ForegroundColor Yellow git status # 检查是否有修改 $status = git status --porcelain if ([string]::IsNullOrWhiteSpace($status)) { Write-Host "✅ 没有需要提交的修改" -ForegroundColor Green exit 0 } Write-Host "发现未提交的修改,开始自动提交流程..." -ForegroundColor Yellow # 查看修改内容 Write-Host "2. 查看修改内容..." -ForegroundColor Yellow git diff --stat # 添加修改到暂存区 Write-Host "3. 添加修改到暂存区..." -ForegroundColor Yellow git add -A Write-Host "✅ 修改已添加到暂存区" -ForegroundColor Green # 提交修改 Write-Host "4. 提交修改..." -ForegroundColor Yellow git commit -m "auto: 自动提交修改 - 自动检验并提交所有修改 - 包含文件更新和配置调整" Write-Host "✅ 修改已提交" -ForegroundColor Green # 推送到远程仓库 Write-Host "5. 推送到远程仓库..." -ForegroundColor Yellow git push origin develop Write-Host "✅ 已推送到远程仓库" -ForegroundColor Green Write-Host "=====================================" -ForegroundColor Cyan Write-Host "✅ 自动检验和提交流程完成!" -ForegroundColor Green Write-Host "=====================================" -ForegroundColor Cyan