fix check failed

This commit is contained in:
pompurin404 2024-08-03 09:09:24 +08:00
parent dd7134c389
commit deeaa5933d
No known key found for this signature in database
3 changed files with 4 additions and 6 deletions

View File

@ -1,4 +1,4 @@
import { ChildProcess, execSync, spawn } from 'child_process' import { ChildProcess, execFileSync, execSync, spawn } from 'child_process'
import { import {
logPath, logPath,
mihomoCorePath, mihomoCorePath,
@ -50,13 +50,11 @@ export function restartCore(): void {
startCore() startCore()
} }
// mihomo -t -d path return status code
export function checkProfile(): void { export function checkProfile(): void {
const corePath = mihomoCorePath(getAppConfig().core ?? 'mihomo') const corePath = mihomoCorePath(getAppConfig().core ?? 'mihomo')
generateProfile()
if (process.platform !== 'win32') { if (process.platform !== 'win32') {
execSync(`chmod +x ${corePath}`) execSync(`chmod +x ${corePath}`)
} }
execSync(`${corePath} -t -f ${mihomoWorkConfigPath()} -d ${mihomoTestDir()}`) execFileSync(corePath, ['-t', '-f', mihomoWorkConfigPath(), '-d', mihomoTestDir()])
} }

View File

@ -17,7 +17,7 @@ const LogItem: React.FC<IMihomoLogInfo> = (props) => {
</div> </div>
<small className="text-default-500">{time}</small> <small className="text-default-500">{time}</small>
</CardHeader> </CardHeader>
<CardBody className="pt-0">{payload}</CardBody> <CardBody className="pt-0 text-sm">{payload}</CardBody>
</Card> </Card>
) )
} }

View File

@ -1,5 +1,5 @@
type OutboundMode = 'rule' | 'global' | 'direct' type OutboundMode = 'rule' | 'global' | 'direct'
type LogLevel = 'info' | 'debug' | 'warn' | 'error' | 'silent' type LogLevel = 'info' | 'debug' | 'warning' | 'error' | 'silent'
type SysProxyMode = 'auto' | 'manual' type SysProxyMode = 'auto' | 'manual'
interface IMihomoVersion { interface IMihomoVersion {
version: string version: string