mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 10:27:33 +00:00
fix(cli): narrow optional native process replacement API
This commit is contained in:
@@ -16,6 +16,13 @@ export function reenterPackagedElectron(): void {
|
||||
if (!packagedElectron) {
|
||||
return
|
||||
}
|
||||
const execve = process.execve
|
||||
if (!execve) {
|
||||
throw new RuntimeClientError(
|
||||
'unsupported_runtime',
|
||||
'The installed Orca runtime is unavailable. Reinstall Orca and try again.'
|
||||
)
|
||||
}
|
||||
try {
|
||||
accessSync(packagedElectron, constants.X_OK)
|
||||
accessSync(process.argv[1], constants.R_OK)
|
||||
@@ -25,7 +32,7 @@ export function reenterPackagedElectron(): void {
|
||||
'The installed Orca app is unavailable. Reinstall Orca and try again.'
|
||||
)
|
||||
}
|
||||
process.execve(packagedElectron, [packagedElectron, ...process.argv.slice(1)], {
|
||||
execve.call(process, packagedElectron, [packagedElectron, ...process.argv.slice(1)], {
|
||||
...process.env,
|
||||
ELECTRON_RUN_AS_NODE: '1'
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user