fix(doctor): improve diagnostic fix message output (#1187)

Problem:
- Diagnostic fix messages were restricted to single lines
- Inconsistent file path formatting in database sync issues
- Outdated cleanup command suggested in maintenance fixes

Solution:
- Implement multiline support for doctor fix messages
- Standardize issue file paths across database diagnostics
- Update maintenance fix instructions to use 'bd admin cleanup'

Impact:
- Clearer and more accurate recovery instructions for users
- Better readability of complex diagnostic output

Fixes: GH#1170, GH#1171, GH#1172
This commit is contained in:
Peter Chanthamynavong
2026-01-19 10:10:57 -08:00
committed by GitHub
parent 73d4d5ecb2
commit 460d2bf113
3 changed files with 14 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ import (
"os"
"path/filepath"
"slices"
"strings"
"time"
_ "github.com/ncruces/go-sqlite3/driver"
@@ -774,7 +775,15 @@ func printDiagnostics(result doctorResult) {
fmt.Printf(" %s %s %s\n", ui.RenderWarnIcon(), ui.RenderWarn(fmt.Sprintf("%d.", i+1)), line)
}
if check.Fix != "" {
fmt.Printf(" %s%s\n", ui.MutedStyle.Render(ui.TreeLast), check.Fix)
// Handle multiline Fix messages with proper indentation
lines := strings.Split(check.Fix, "\n")
for i, line := range lines {
if i == 0 {
fmt.Printf(" %s%s\n", ui.MutedStyle.Render(ui.TreeLast), line)
} else {
fmt.Printf(" %s\n", line)
}
}
}
}
} else {