From 1152321c3035be0e95d58db0bd09897a3c1133f7 Mon Sep 17 00:00:00 2001 From: fhysy <1149505133@qq.com> Date: Mon, 15 Jul 2024 14:50:58 +0800 Subject: [PATCH] =?UTF-8?q?=20feat(=E5=BA=94=E7=94=A8=E7=A8=8B=E5=BA=8F):?= =?UTF-8?q?=20=E6=9B=B4=E6=96=B0=E5=90=8E=E7=AB=AF=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/plugin-test/test_test_get | 3 --- .../{plugin-test => service}/config/config.yaml | 0 .../{plugin-test => service}/plugins/gateway.exe | Bin src/main/index.js | 10 ++++++---- 4 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 resources/plugin-test/test_test_get rename resources/{plugin-test => service}/config/config.yaml (100%) rename resources/{plugin-test => service}/plugins/gateway.exe (100%) diff --git a/resources/plugin-test/test_test_get b/resources/plugin-test/test_test_get deleted file mode 100644 index 6823a22..0000000 --- a/resources/plugin-test/test_test_get +++ /dev/null @@ -1,3 +0,0 @@ -张三 - -Written from plugin-test-grpc \ No newline at end of file diff --git a/resources/plugin-test/config/config.yaml b/resources/service/config/config.yaml similarity index 100% rename from resources/plugin-test/config/config.yaml rename to resources/service/config/config.yaml diff --git a/resources/plugin-test/plugins/gateway.exe b/resources/service/plugins/gateway.exe similarity index 100% rename from resources/plugin-test/plugins/gateway.exe rename to resources/service/plugins/gateway.exe diff --git a/src/main/index.js b/src/main/index.js index ac2ef6e..d14ac1a 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -98,11 +98,12 @@ if (!gotTheLock) { const path = require('path') const logStream = fs.createWriteStream('app.log', { flags: 'a' }) // 日志文件 - let exePath = path.resolve('./resources/app.asar.unpacked/resources/plugin-test') - let exePluginsPath = path.resolve('./resources/app.asar.unpacked/resources/plugin-test/plugins') + let exePath = path.resolve('./resources/app.asar.unpacked/resources/service') + let exePluginsPath = path.resolve('./resources/app.asar.unpacked/resources/service/plugins') + //单独配置测试环境 if (process.env.NODE_ENV === 'development') { - exePath = path.resolve('./resources/plugin-test') - exePluginsPath = path.resolve('./resources/plugin-test/plugins') + exePath = path.resolve('./resources/service') + exePluginsPath = path.resolve('./resources/service/plugins') } //查询所有插件目录下的exe文件 @@ -116,6 +117,7 @@ if (!gotTheLock) { child = spawn('./main.exe', [], { cwd: exePath, stdio: ['ignore', 'pipe', 'pipe'] }) + //监听进程的输出 child.stdout.on('data', (data) => { console.log('stdout:', data.toString()) logStream.write(data)