1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 19:40:07 +00:00

fix(status): correct external disk capacity totals

This commit is contained in:
Tw93
2026-03-19 13:33:22 +08:00
parent 584e10cdc4
commit 6e1dfd20e7
3 changed files with 169 additions and 27 deletions

View File

@@ -347,7 +347,7 @@ func (c *Collector) Collect() (MetricsSnapshot, error) {
}, mergeErr
}
func runCmd(ctx context.Context, name string, args ...string) (string, error) {
var runCmd = func(ctx context.Context, name string, args ...string) (string, error) {
cmd := exec.CommandContext(ctx, name, args...)
output, err := cmd.Output()
if err != nil {
@@ -356,7 +356,7 @@ func runCmd(ctx context.Context, name string, args ...string) (string, error) {
return string(output), nil
}
func commandExists(name string) bool {
var commandExists = func(name string) bool {
if name == "" {
return false
}