chore: add back env paths setting so cortex engine can load libraries properly (#4625)

* chore: add back env paths setting so cortex engine can load libraries properly

* chore: bump cortex
This commit is contained in:
Louis 2025-02-11 13:55:25 +07:00 committed by GitHub
parent 1fe15236a0
commit 931d70fc50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 1 deletions

View File

@ -1 +1 @@
1.0.10-rc1
1.0.10-rc3

View File

@ -27,6 +27,9 @@ function run(): Promise<any> {
const binPath = path.join(__dirname, '..', 'bin')
const executablePath = path.join(binPath, binaryName)
addEnvPaths(binPath)
const sharedPath = path.join(appResourcePath(), 'shared')
// Execute the binary
log(`[CORTEX]:: Spawn cortex at path: ${executablePath}`)
@ -75,6 +78,22 @@ function dispose() {
watchdog?.terminate()
}
/**
* Set the environment paths for the cortex subprocess
* @param dest
*/
function addEnvPaths(dest: string) {
// Add engine path to the PATH and LD_LIBRARY_PATH
if (process.platform === 'win32') {
process.env.PATH = (process.env.PATH || '').concat(path.delimiter, dest)
} else {
process.env.LD_LIBRARY_PATH = (process.env.LD_LIBRARY_PATH || '').concat(
path.delimiter,
dest
)
}
}
/**
* Cortex process info
*/