Skip to content

Commit 1f8bcd4

Browse files
committed
do not show uninstall if nothing is being uninstalled
1 parent 22aca1e commit 1f8bcd4

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

cmd/dot/main.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,23 @@ func (a *App) Run(args []string) error {
357357
if err != nil {
358358
fmt.Fprintf(os.Stderr, "Warning: failed to uninstall removed components: %v\n", err)
359359
} else if len(uninstallResults) > 0 {
360-
if a.Verbose {
361-
fmt.Printf("📦 Found %d removed components to uninstall\n", len(uninstallResults))
360+
// Only show "Uninstalled removed components" if actual uninstall commands were executed
361+
var actualUninstalls []component.InstallResult
362+
for _, result := range uninstallResults {
363+
if result.InstallResult != nil {
364+
actualUninstalls = append(actualUninstalls, result)
365+
}
366+
}
367+
368+
if len(actualUninstalls) > 0 {
369+
if a.Verbose {
370+
fmt.Printf("📦 Found %d removed components with uninstall commands\n", len(actualUninstalls))
371+
}
372+
fmt.Println("\nUninstalled removed components:")
373+
a.printResults("Uninstall", actualUninstalls)
374+
} else if a.Verbose {
375+
fmt.Printf("✓ Cleaned up %d removed components (links only)\n", len(uninstallResults))
362376
}
363-
fmt.Println("\nUninstalled removed components:")
364-
a.printResults("Uninstall", uninstallResults)
365377
} else if a.Verbose {
366378
fmt.Printf("✓ No removed components found\n")
367379
}

0 commit comments

Comments
 (0)