history: print urls after importing builds

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi 2025-03-04 16:13:49 -08:00
parent fea7459880
commit 963b9ca30d
No known key found for this signature in database
GPG Key ID: AFA9DE5F8AB7AF39

View File

@ -23,7 +23,7 @@ type importOptions struct {
file string 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() sock, err := desktop.BuildServerAddr()
if err != nil { if err != nil {
return err 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") return errors.New("no build records found in the bundle")
} }
url := desktop.BuildURL(fmt.Sprintf(".imported/_/%s", refs[0])) for i, ref := range refs {
return browser.OpenURL(url) 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 { func importCmd(dockerCli command.Cli, _ RootOptions) *cobra.Command {