Ver código fonte

chore: 构建脚本自动清理 .exe~ 备份残留(约 5 MB)

caesar 16 horas atrás
pai
commit
6a9a14596e
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      build.ps1

+ 3 - 0
build.ps1

@@ -23,6 +23,9 @@ try {
     go build -trimpath -ldflags "-H=windowsgui -s -w -X main.appVersion=$Version" -o deepseek-tray.exe .
     if ($LASTEXITCODE -ne 0) { throw 'go build 失败' }
 
+    # 目标 exe 被运行中的实例占用时,Go 会留下 .exe~ 备份(约 5 MB),顺手清理
+    Get-ChildItem -Filter '*.exe~' -ErrorAction SilentlyContinue | Remove-Item -Force -ErrorAction SilentlyContinue
+
     $size = [math]::Round((Get-Item 'deepseek-tray.exe').Length / 1KB, 0)
     Write-Host ('构建成功: deepseek-tray.exe (' + $size + ' KB, v' + $Version + ')') -ForegroundColor Green
 } finally {