From 963b9ca30dafeea6c191f0bafebead3b13953cd6 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Tue, 4 Mar 2025 16:13:49 -0800 Subject: [PATCH] history: print urls after importing builds Signed-off-by: Tonis Tiigi --- commands/history/import.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/commands/history/import.go b/commands/history/import.go index 48995d94..926f68d7 100644 --- a/commands/history/import.go +++ b/commands/history/import.go @@ -23,7 +23,7 @@ type importOptions struct { file string } -func runImport(ctx context.Context, _ command.Cli, opts importOptions) error { +func runImport(ctx context.Context, dockerCli command.Cli, opts importOptions) error { sock, err := desktop.BuildServerAddr() if err != nil { return err @@ -78,8 +78,15 @@ func runImport(ctx context.Context, _ command.Cli, opts importOptions) error { return errors.New("no build records found in the bundle") } - url := desktop.BuildURL(fmt.Sprintf(".imported/_/%s", refs[0])) - return browser.OpenURL(url) + for i, ref := range refs { + url := desktop.BuildURL(fmt.Sprintf(".imported/_/%s", ref)) + fmt.Fprintln(dockerCli.Err(), url) + if i == 0 { + err = browser.OpenURL(url) + } + } + + return err } func importCmd(dockerCli command.Cli, _ RootOptions) *cobra.Command {