sloth-d2c-mcp 1.0.4-beta97 → 1.0.4-beta99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/run.js +4 -1
- package/cli/sloth-server.log +11698 -0
- package/dist/build/index.js +3 -1
- package/dist/build/plugin/loader.js +19 -4
- package/dist/build/plugin/types.js +6 -1
- package/dist/build/server.js +3 -3
- package/dist/interceptor-web/dist/build-report.json +1 -1
- package/dist/interceptor-web/dist/detail.html +1 -1
- package/dist/interceptor-web/dist/index.html +1 -1
- package/package.json +3 -3
package/cli/run.js
CHANGED
|
@@ -97,12 +97,15 @@ if (args[0] === 'config') {
|
|
|
97
97
|
// run 命令:后台运行 sloth --stdio
|
|
98
98
|
const { spawn } = await import('node:child_process');
|
|
99
99
|
const { fileURLToPath } = await import('node:url');
|
|
100
|
+
const path = await import('node:path');
|
|
100
101
|
|
|
101
102
|
// 获取当前脚本路径(兼容 Node.js 18)
|
|
102
103
|
const scriptPath = fileURLToPath(import.meta.url);
|
|
104
|
+
// 指向scriptPath目录下的log
|
|
105
|
+
const logPath = path.resolve(path.dirname(scriptPath), 'sloth-server.log');
|
|
103
106
|
|
|
104
107
|
// 后台启动子进程
|
|
105
|
-
const child = spawn(process.execPath, [scriptPath, '--server'], {
|
|
108
|
+
const child = spawn(process.execPath, [scriptPath, '--server', '--log='+logPath], {
|
|
106
109
|
detached: true,
|
|
107
110
|
stdio: 'ignore',
|
|
108
111
|
env: { ...process.env, NODE_ENV: 'cli' }
|