From b0260421349525b0757a28706b758be902b55cc4 Mon Sep 17 00:00:00 2001 From: yusheng929 <2624367622@qq.com> Date: Wed, 28 Aug 2024 09:52:17 +0800 Subject: [PATCH] =?UTF-8?q?#=E9=93=83=E6=8E=A8=E9=80=81fix:=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=82=A8=E5=AD=98=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/state.js | 2 +- state/Disk.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/state.js b/apps/state.js index dcc8c4e..301fa4a 100644 --- a/apps/state.js +++ b/apps/state.js @@ -9,7 +9,7 @@ export const State = karin.command(/^#系统信息$/, async (e) => { const RAMB = await RAM.SwapRAMUsage() const adapter = e.bot.adapter.name const implementation = e.bot.version.app_name || e.bot.version.name - const disk = await Disk.Disk() + const disk = Disk.Disk() const system = System.System() // 组装消息 diff --git a/state/Disk.js b/state/Disk.js index 7709fd2..bf898c1 100644 --- a/state/Disk.js +++ b/state/Disk.js @@ -1,14 +1,14 @@ import os from 'os' import { execSync } from 'child_process' -const Disk = async () => { +const Disk = () => { try { let output = '' const platform = os.platform() if (platform === 'win32') { // Windows 系统使用 wmic 命令 - output = await execSync('wmic logicaldisk get size,freespace,caption').toString() + output = execSync('wmic logicaldisk get size,freespace,caption').toString() const lines = output.trim().split('\n') const diskInfo = [] @@ -28,7 +28,7 @@ const Disk = async () => { return diskInfo.length > 0 ? diskInfo.join('\n') : '无法获取磁盘信息' } else if (platform === 'linux' || platform === 'darwin') { // Linux 和 macOS 系统使用 df 命令 - output = await execSync('df -h /').toString() + output = execSync('df -h /').toString() const lines = output.trim().split('\n') const data = lines[1].split(/\s+/) const totalSize = data[1]