mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-06-05 15:39:56 +08:00
fix(ui): 用 path.resolve 规范化开发模式下的进程启动路径
run-common.ts 和 launch-daemon.ts 中对 process.argv[1] 应用 resolve(), 避免开发模式下相对路径导致子进程启动失败。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { resolve } from 'path'
|
||||
import { AUTO_CHAT_ERROR_EXIT_CODE } from '../../common/enums/auto-start-chat'
|
||||
import { daemonEE, sendToDaemon } from '../flow/OPEN_SETTING_WINDOW/connect-to-daemon'
|
||||
import { saveAndGetCurrentRunRecord } from '../flow/OPEN_SETTING_WINDOW/utils/db'
|
||||
@@ -43,7 +44,7 @@ export async function runCommon({ mode }) {
|
||||
}
|
||||
const args =
|
||||
process.env.NODE_ENV === 'development'
|
||||
? [process.argv[1], `--mode=${mode}`, `--run-record-id=${currentRunRecord?.id || 0}`]
|
||||
? [resolve(process.argv[1]), `--mode=${mode}`, `--run-record-id=${currentRunRecord?.id || 0}`]
|
||||
: [`--mode=${mode}`, `--run-record-id=${currentRunRecord?.id || 0}`]
|
||||
await sendToDaemon(
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { spawn } from 'child_process'
|
||||
import { resolve } from 'path'
|
||||
import {
|
||||
ensureStorageFileExist,
|
||||
writeStorageFile,
|
||||
@@ -29,7 +30,7 @@ export async function launchDaemon() {
|
||||
daemonProcess = spawn(
|
||||
process.argv[0],
|
||||
process.env.NODE_ENV === 'development'
|
||||
? [process.argv[1], `--mode=launchDaemon`]
|
||||
? [resolve(process.argv[1]), `--mode=launchDaemon`]
|
||||
: [`--mode=launchDaemon`],
|
||||
{
|
||||
stdio: ['ignore', 'pipe', 'pipe', 'pipe'],
|
||||
|
||||
Reference in New Issue
Block a user