From e264f653384d3624b5e9ddc178a30a5372d693d0 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 6 Mar 2023 06:12:39 -0300 Subject: [PATCH] fix: add force flag to codesign to avoid already signed error (#1756) Co-authored-by: Daniel Lando --- lib/mach-o.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/mach-o.ts b/lib/mach-o.ts index 27d9c639b..d4d832a81 100644 --- a/lib/mach-o.ts +++ b/lib/mach-o.ts @@ -59,7 +59,9 @@ function patchMachOExecutable(file: Buffer) { function signMachOExecutable(executable: string) { try { - execFileSync('codesign', ['--sign', '-', executable], { stdio: 'inherit' }); + execFileSync('codesign', ['-f', '--sign', '-', executable], { + stdio: 'inherit', + }); } catch { execFileSync('ldid', ['-Cadhoc', '-S', executable], { stdio: 'inherit' }); }