chore: update symbolic type
This commit is contained in:
parent
99388f4418
commit
ae7a6c5d64
@ -140,8 +140,8 @@ const symlinkEngines = async () => {
|
|||||||
recursive: true,
|
recursive: true,
|
||||||
}).catch((error) => log(JSON.stringify(error)))
|
}).catch((error) => log(JSON.stringify(error)))
|
||||||
|
|
||||||
await symlink(targetVariantPath, symlinkVariantPath).catch((error) =>
|
await symlink(targetVariantPath, symlinkVariantPath, 'junction').catch(
|
||||||
log(JSON.stringify(error))
|
(error) => log(JSON.stringify(error))
|
||||||
)
|
)
|
||||||
console.log(`Symlink created: ${targetVariantPath} -> ${symlinkEnginePath}`)
|
console.log(`Symlink created: ${targetVariantPath} -> ${symlinkEnginePath}`)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { appResourcePath, getJanDataFolderPath, log, SystemInformation } from '@janhq/core/node'
|
import {
|
||||||
|
appResourcePath,
|
||||||
|
getJanDataFolderPath,
|
||||||
|
log,
|
||||||
|
SystemInformation,
|
||||||
|
} from '@janhq/core/node'
|
||||||
import { ProcessWatchdog } from './watchdog'
|
import { ProcessWatchdog } from './watchdog'
|
||||||
import { readdir, symlink } from 'fs/promises'
|
import { readdir, symlink } from 'fs/promises'
|
||||||
|
|
||||||
@ -21,10 +26,7 @@ function run(systemInfo?: SystemInformation): Promise<any> {
|
|||||||
await createEngineSymlinks(binPath)
|
await createEngineSymlinks(binPath)
|
||||||
|
|
||||||
const executablePath = path.join(binPath, binaryName)
|
const executablePath = path.join(binPath, binaryName)
|
||||||
const sharedPath = path.join(
|
const sharedPath = path.join(appResourcePath(), 'shared')
|
||||||
appResourcePath(),
|
|
||||||
'shared'
|
|
||||||
)
|
|
||||||
// Execute the binary
|
// Execute the binary
|
||||||
log(`[CORTEX]:: Spawn cortex at path: ${executablePath}`)
|
log(`[CORTEX]:: Spawn cortex at path: ${executablePath}`)
|
||||||
|
|
||||||
@ -72,7 +74,9 @@ async function createEngineSymlinks(binPath: string) {
|
|||||||
if (sharedLibFile.endsWith('.dll') || sharedLibFile.endsWith('.so')) {
|
if (sharedLibFile.endsWith('.dll') || sharedLibFile.endsWith('.so')) {
|
||||||
const targetDllPath = path.join(sharedPath, sharedLibFile)
|
const targetDllPath = path.join(sharedPath, sharedLibFile)
|
||||||
const symlinkDllPath = path.join(binPath, sharedLibFile)
|
const symlinkDllPath = path.join(binPath, sharedLibFile)
|
||||||
await symlink(targetDllPath, symlinkDllPath).catch(console.error)
|
await symlink(targetDllPath, symlinkDllPath, 'junction').catch(
|
||||||
|
console.error
|
||||||
|
)
|
||||||
console.log(`Symlink created: ${targetDllPath} -> ${symlinkDllPath}`)
|
console.log(`Symlink created: ${targetDllPath} -> ${symlinkDllPath}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user