This commit is contained in:
cc
2026-03-26 22:34:50 +08:00
parent 2fcbb026df
commit 8b8c5f33ce

View File

@@ -385,11 +385,11 @@ export class KeyServiceMac {
// 通过 try/on error 回传详细错误,避免只看到 "Command failed" // 通过 try/on error 回传详细错误,避免只看到 "Command failed"
const scriptLines = [ const scriptLines = [
`set helperPath to ${JSON.stringify(helperPath)}`, `set helperPath to ${JSON.stringify(helperPath)}`,
`set cmd to quoted form of helperPath & " ${pid} ${waitMs} 2>&1"`, `set cmd to quoted form of helperPath & " ${pid} ${waitMs}"`,
`set timeoutSec to ${timeoutSec}`, `set timeoutSec to ${timeoutSec}`,
'try', 'try',
'with timeout of timeoutSec seconds', 'with timeout of timeoutSec seconds',
'set outText to do shell script cmd with administrator privileges', 'set outText to do shell script (cmd & " 2>&1") with administrator privileges',
'end timeout', 'end timeout',
'return "WF_OK::" & outText', 'return "WF_OK::" & outText',
'on error errMsg number errNum partial result pr', 'on error errMsg number errNum partial result pr',