style(tools): unify console output with [I/W/E] [Module] color-coded format

- Add ANSI color coding: [I]=green, [W]=yellow, [E]=red
- Format: [Level] [Module] message with 4-char indent for data rows
- Error detail lines use |-> tree connector
- Remove extra blank lines between outputs (except list)
- Modules: CLI, Preview, Builder, Server, Watcher

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
KenanZhuandClaude Opus 4.8 committed 2026-06-05 14:21:25 +08:00
1 parent d46f702664
commit da8bb2e1a2
8 files changed
+46 -40

No files matched your search

+2 -2
View File
@@ -37,14 +37,14 @@ func runDelete(c *cli.Context) error {
styleDir := filepath.Join(folder, styleName)
if _, err := os.Stat(styleDir); os.IsNotExist(err) {
fmt.Printf(" [skip] '%s' does not exist\n", styleName)
fmt.Printf("\033[33m[W]\033[0m [CLI] '%s' does not exist, skipped\n", styleName)
continue
}
if err := os.RemoveAll(styleDir); err != nil {
return fmt.Errorf("cannot delete %s: %w", styleDir, err)
}
fmt.Printf(" Deleted style '%s'\n", styleName)
fmt.Printf("\033[32m[I]\033[0m [CLI] Deleted style '%s'\n", styleName)
}
return nil