chore(scripts): 新增一键部署脚本 deploy.ps1

This commit is contained in:
ali
2026-11-17 12:14:41 +08:00
parent b4ff7fae86
commit baaf5a330c
+8 -2
View File
@@ -75,8 +75,14 @@ try {
if (-not $Message) { throw '-Commit 需要同时提供 -Message "提交说明"' }
Write-Host '▶ 本地提交并推送 ...' -ForegroundColor Cyan
& git add -A
& git commit -m $Message
if ($LASTEXITCODE -ne 0) { throw 'git commit 失败(可能没有改动)' }
& git diff --cached --quiet
if ($LASTEXITCODE -eq 0) {
Write-Host ' 没有待提交改动,跳过 commit' -ForegroundColor DarkGray
}
else {
& git commit -m $Message
if ($LASTEXITCODE -ne 0) { throw 'git commit 失败' }
}
& git push origin main
if ($LASTEXITCODE -ne 0) { throw 'git push 失败' }