From d611bbe60973dcbf5250e5d5ea5fdc2ae219b7b8 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Sun, 15 May 2022 06:10:42 +0200 Subject: [PATCH] rm: display name of removed builder Signed-off-by: CrazyMax --- commands/rm.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/commands/rm.go b/commands/rm.go index 6e387ed4..73144066 100644 --- a/commands/rm.go +++ b/commands/rm.go @@ -2,6 +2,7 @@ package commands import ( "context" + "fmt" "time" "github.com/docker/buildx/store" @@ -73,7 +74,12 @@ func runRm(dockerCli command.Cli, in rmOptions) error { if err := txn.Remove(ng.Name); err != nil { return err } - return err1 + if err1 != nil { + return err1 + } + + _, _ = fmt.Fprintf(dockerCli.Err(), "%s removed\n", ng.Name) + return nil } func rmCmd(dockerCli command.Cli, rootOpts *rootOptions) *cobra.Command { @@ -158,6 +164,7 @@ func rmAllInactive(ctx context.Context, txn *store.Txn, dockerCli command.Cli, i if err := txn.Remove(b.ng.Name); err != nil { return err } + _, _ = fmt.Fprintf(dockerCli.Err(), "%s removed\n", b.ng.Name) return rmerr } return nil