feat(应用程序): 更新后端服务目录

This commit is contained in:
fhysy 2024-07-15 14:50:58 +08:00
parent 7b98fca398
commit 1152321c30
4 changed files with 6 additions and 7 deletions

View File

@ -1,3 +0,0 @@
张三
Written from plugin-test-grpc

View File

@ -98,11 +98,12 @@ if (!gotTheLock) {
const path = require('path') const path = require('path')
const logStream = fs.createWriteStream('app.log', { flags: 'a' }) // 日志文件 const logStream = fs.createWriteStream('app.log', { flags: 'a' }) // 日志文件
let exePath = path.resolve('./resources/app.asar.unpacked/resources/plugin-test') let exePath = path.resolve('./resources/app.asar.unpacked/resources/service')
let exePluginsPath = path.resolve('./resources/app.asar.unpacked/resources/plugin-test/plugins') let exePluginsPath = path.resolve('./resources/app.asar.unpacked/resources/service/plugins')
//单独配置测试环境
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
exePath = path.resolve('./resources/plugin-test') exePath = path.resolve('./resources/service')
exePluginsPath = path.resolve('./resources/plugin-test/plugins') exePluginsPath = path.resolve('./resources/service/plugins')
} }
//查询所有插件目录下的exe文件 //查询所有插件目录下的exe文件
@ -116,6 +117,7 @@ if (!gotTheLock) {
child = spawn('./main.exe', [], { cwd: exePath, stdio: ['ignore', 'pipe', 'pipe'] }) child = spawn('./main.exe', [], { cwd: exePath, stdio: ['ignore', 'pipe', 'pipe'] })
//监听进程的输出
child.stdout.on('data', (data) => { child.stdout.on('data', (data) => {
console.log('stdout:', data.toString()) console.log('stdout:', data.toString())
logStream.write(data) logStream.write(data)