From 32687033fc195db8f6f515af512e5d5d7089097a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 16 Apr 2026 22:55:35 -0400 Subject: [PATCH] build(mac-sign): remove codesign retry loop, let it crash (P3-29) --- scripts/electron-builder-mac-sign.mjs | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/scripts/electron-builder-mac-sign.mjs b/scripts/electron-builder-mac-sign.mjs index 30aa5831..d72b7105 100644 --- a/scripts/electron-builder-mac-sign.mjs +++ b/scripts/electron-builder-mac-sign.mjs @@ -2,10 +2,6 @@ import { spawn } from "node:child_process"; import { readdir } from "node:fs/promises"; import { extname } from "node:path"; -function delay(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); -} - async function runCommand(command, args, capture = false) { return await new Promise((resolve, reject) => { const child = spawn(command, args, { @@ -118,22 +114,7 @@ async function collectSignTargets(rootPath) { async function signTarget(targetPath, context) { const fileOptions = context.optionsForFile?.(targetPath) ?? {}; const args = buildCodesignArgs(targetPath, context.identity, context.keychain, fileOptions); - - let lastError; - for (let attempt = 0; attempt < 3; attempt += 1) { - try { - await runCodesign(args); - return; - } catch (error) { - lastError = error; - if (attempt === 2) { - throw error; - } - await delay(5000); - } - } - - throw lastError; + await runCodesign(args); } export default async function sign(context) {