1
1
mirror of https://github.com/leon-ai/leon.git synced 2025-01-02 13:43:51 +03:00

refactor(scripts): add bin level for Node.js bridge

This commit is contained in:
louistiti 2023-05-01 01:13:19 +08:00
parent 0e4ec4fb97
commit 8dc8c05d7d
No known key found for this signature in database
GPG Key ID: 92CD6A2E497E1669
2 changed files with 6 additions and 3 deletions

View File

@ -88,7 +88,7 @@ const setupBinaries = async (key) => {
if (!manifest || manifest.version !== version) {
const buildPath = isPlatformDependent
? path.join(distPath, BINARIES_FOLDER_NAME)
: distPath
: path.join(distPath, 'bin')
const archivePath = path.join(distPath, archiveName)
await Promise.all([
@ -130,7 +130,9 @@ const setupBinaries = async (key) => {
LogHelper.success(`${name} downloaded`)
LogHelper.info(`Extracting ${name}...`)
const absoluteDistPath = path.resolve(distPath)
const absoluteDistPath = isPlatformDependent
? path.resolve(distPath)
: path.resolve(distPath, 'bin')
await extractZip(archivePath, { dir: absoluteDistPath })
LogHelper.success(`${name} extracted`)
@ -151,7 +153,7 @@ const setupBinaries = async (key) => {
}
export default async () => {
// await setupBinaries('nodejs-bridge')
await setupBinaries('nodejs-bridge')
await setupBinaries('python-bridge')
await setupBinaries('tcp-server')
}

View File

@ -74,6 +74,7 @@ export const PYTHON_BRIDGE_BIN_PATH = path.join(
)
export const NODEJS_BRIDGE_BIN_PATH = `${process.execPath} ${path.join(
NODEJS_BRIDGE_DIST_PATH,
'bin',
NODEJS_BRIDGE_BIN_NAME
)}`