mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 05:30:07 +08:00
✏️ aifalese 磁盘空间占用仅输出非0挂载点
This commit is contained in:
parent
f202797964
commit
3b637fad78
@ -58,7 +58,10 @@ func diskPercent() string {
|
||||
msg := ""
|
||||
for _, p := range parts {
|
||||
diskInfo, _ := disk.Usage(p.Mountpoint)
|
||||
msg += fmt.Sprintf("\n - %s(%dM) %d%%", p.Mountpoint, diskInfo.Total/1024/1024, uint(math.Round(diskInfo.UsedPercent)))
|
||||
pc := uint(math.Round(diskInfo.UsedPercent))
|
||||
if pc > 0 {
|
||||
msg += fmt.Sprintf("\n - %s(%dM) %d%%", p.Mountpoint, diskInfo.Total/1024/1024, pc)
|
||||
}
|
||||
}
|
||||
return msg
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user