From baaf5a330c340f40a7e80d9032d2b5b5ab666230 Mon Sep 17 00:00:00 2001 From: ali Date: Tue, 17 Nov 2026 12:14:41 +0800 Subject: [PATCH] =?UTF-8?q?chore(scripts):=20=E6=96=B0=E5=A2=9E=E4=B8=80?= =?UTF-8?q?=E9=94=AE=E9=83=A8=E7=BD=B2=E8=84=9A=E6=9C=AC=20deploy.ps1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/deploy.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/deploy.ps1 b/scripts/deploy.ps1 index 2355f8b..aac3dcd 100644 --- a/scripts/deploy.ps1 +++ b/scripts/deploy.ps1 @@ -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 失败' }