From 07a9b07f7bf14bc27080384690c1080ab5aec6e8 Mon Sep 17 00:00:00 2001 From: pompurin404 Date: Sat, 3 Aug 2024 09:09:24 +0800 Subject: [PATCH] fix check failed --- src/main/core/manager.ts | 6 ++---- src/renderer/src/components/logs/log-item.tsx | 2 +- src/shared/types.d.ts | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/core/manager.ts b/src/main/core/manager.ts index 01db7110..29a5f32f 100644 --- a/src/main/core/manager.ts +++ b/src/main/core/manager.ts @@ -1,4 +1,4 @@ -import { ChildProcess, execSync, spawn } from 'child_process' +import { ChildProcess, execFileSync, execSync, spawn } from 'child_process' import { logPath, mihomoCorePath, @@ -50,13 +50,11 @@ export function restartCore(): void { startCore() } -// mihomo -t -d path return status code export function checkProfile(): void { const corePath = mihomoCorePath(getAppConfig().core ?? 'mihomo') - generateProfile() if (process.platform !== 'win32') { execSync(`chmod +x ${corePath}`) } - execSync(`${corePath} -t -f ${mihomoWorkConfigPath()} -d ${mihomoTestDir()}`) + execFileSync(corePath, ['-t', '-f', mihomoWorkConfigPath(), '-d', mihomoTestDir()]) } diff --git a/src/renderer/src/components/logs/log-item.tsx b/src/renderer/src/components/logs/log-item.tsx index 83c8bbc3..d8e85562 100644 --- a/src/renderer/src/components/logs/log-item.tsx +++ b/src/renderer/src/components/logs/log-item.tsx @@ -17,7 +17,7 @@ const LogItem: React.FC = (props) => { {time} - {payload} + {payload} ) } diff --git a/src/shared/types.d.ts b/src/shared/types.d.ts index fed465dc..ae715704 100644 --- a/src/shared/types.d.ts +++ b/src/shared/types.d.ts @@ -1,5 +1,5 @@ type OutboundMode = 'rule' | 'global' | 'direct' -type LogLevel = 'info' | 'debug' | 'warn' | 'error' | 'silent' +type LogLevel = 'info' | 'debug' | 'warning' | 'error' | 'silent' type SysProxyMode = 'auto' | 'manual' interface IMihomoVersion { version: string