mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-24 23:06:51 +00:00
fix: osascript 使用完整路径,修复打包后 ENOENT 问题
This commit is contained in:
@@ -370,7 +370,7 @@ export class KeyServiceMac {
|
|||||||
|
|
||||||
let stdout = ''
|
let stdout = ''
|
||||||
try {
|
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
|
timeout: waitMs + 20_000
|
||||||
})
|
})
|
||||||
stdout = result.stdout
|
stdout = result.stdout
|
||||||
@@ -434,7 +434,7 @@ export class KeyServiceMac {
|
|||||||
]
|
]
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await execFileAsync('osascript', script.flatMap(line => ['-e', line]), {
|
await execFileAsync('/usr/bin/osascript', script.flatMap(line => ['-e', line]), {
|
||||||
timeout: 30_000
|
timeout: 30_000
|
||||||
})
|
})
|
||||||
return true
|
return true
|
||||||
@@ -777,7 +777,7 @@ export class KeyServiceMac {
|
|||||||
let child: ReturnType<typeof spawn>
|
let child: ReturnType<typeof spawn>
|
||||||
if (elevated) {
|
if (elevated) {
|
||||||
const shellCmd = `'${helperPath}' ${pid} ${ciphertextHex}`
|
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'] })
|
{ stdio: ['ignore', 'pipe', 'pipe'] })
|
||||||
} else {
|
} else {
|
||||||
child = spawn(helperPath, [String(pid), ciphertextHex], { stdio: ['ignore', 'pipe', 'pipe'] })
|
child = spawn(helperPath, [String(pid), ciphertextHex], { stdio: ['ignore', 'pipe', 'pipe'] })
|
||||||
|
|||||||
Reference in New Issue
Block a user