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 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' }