瀏覽代碼

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

caesar 17 小時之前
父節點
當前提交
6a9a14596e
共有 1 個文件被更改,包括 3 次插入 和 0 次删除
  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 {