From b274c99b91689f746c64438e746cc631f67b11f9 Mon Sep 17 00:00:00 2001 From: hicccc77 <98377878+hicccc77@users.noreply.github.com> Date: Sat, 14 Mar 2026 19:28:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20osascript=20=E4=BD=BF=E7=94=A8=E5=AE=8C?= =?UTF-8?q?=E6=95=B4=E8=B7=AF=E5=BE=84=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=89=93?= =?UTF-8?q?=E5=8C=85=E5=90=8E=20ENOENT=20=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/services/keyServiceMac.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/electron/services/keyServiceMac.ts b/electron/services/keyServiceMac.ts index 9e63463..1699c87 100644 --- a/electron/services/keyServiceMac.ts +++ b/electron/services/keyServiceMac.ts @@ -370,7 +370,7 @@ export class KeyServiceMac { let stdout = '' try { - const result = await execFileAsync('osascript', scriptLines.flatMap(line => ['-e', line]), { + const result = await execFileAsync('/usr/bin/osascript', scriptLines.flatMap(line => ['-e', line]), { timeout: waitMs + 20_000 }) stdout = result.stdout @@ -434,7 +434,7 @@ export class KeyServiceMac { ] try { - await execFileAsync('osascript', script.flatMap(line => ['-e', line]), { + await execFileAsync('/usr/bin/osascript', script.flatMap(line => ['-e', line]), { timeout: 30_000 }) return true @@ -777,7 +777,7 @@ export class KeyServiceMac { let child: ReturnType if (elevated) { const shellCmd = `'${helperPath}' ${pid} ${ciphertextHex}` - child = spawn('osascript', ['-e', `do shell script ${JSON.stringify(shellCmd)} with administrator privileges`], + child = spawn('/usr/bin/osascript', ['-e', `do shell script ${JSON.stringify(shellCmd)} with administrator privileges`], { stdio: ['ignore', 'pipe', 'pipe'] }) } else { child = spawn(helperPath, [String(pid), ciphertextHex], { stdio: ['ignore', 'pipe', 'pipe'] })