From 1a1e313f3028243680c29520d96f722092a2bd38 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Tue, 26 Nov 2019 20:46:00 +0100 Subject: bridge: move export event handling to the CLI --- commands/bridge_push.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'commands') diff --git a/commands/bridge_push.go b/commands/bridge_push.go index 26f42dc4..95ad5f5e 100644 --- a/commands/bridge_push.go +++ b/commands/bridge_push.go @@ -63,11 +63,25 @@ func runBridgePush(cmd *cobra.Command, args []string) error { return nil }) - err = b.ExportAll(ctx, time.Time{}) + events, err := b.ExportAll(ctx, time.Time{}) if err != nil { return err } + exportedIssues := 0 + for result := range events { + if result.Event != core.ExportEventNothing { + fmt.Println(result.String()) + } + + switch result.Event { + case core.ExportEventBug: + exportedIssues++ + } + } + + fmt.Printf("exported %d issues with %s bridge\n", exportedIssues, b.Name) + // send done signal close(done) return nil -- cgit