diff --git a/cli/cmd/deploy/cmd.go b/cli/cmd/deploy/cmd.go index d335f47..42fdc65 100644 --- a/cli/cmd/deploy/cmd.go +++ b/cli/cmd/deploy/cmd.go @@ -8,7 +8,6 @@ import ( "numerous/cli/internal/app" "numerous/cli/internal/gql" - "github.com/hasura/go-graphql-client" "github.com/spf13/cobra" ) @@ -60,7 +59,7 @@ var ( ) func run(cmd *cobra.Command, args []string) { - sc := gql.NewSubscriptionClient().OnError(func(sc *graphql.SubscriptionClient, err error) error { println("ERROR", err.Error()); return err }) + sc := gql.NewSubscriptionClient().WithSyncMode(true) service := app.New(gql.NewClient(), sc, http.DefaultClient) err := Deploy(cmd.Context(), service, appDir, projectDir, slug, appName, verbose) diff --git a/cli/cmd/output/task.go b/cli/cmd/output/task.go index 785fcd5..5bc592d 100644 --- a/cli/cmd/output/task.go +++ b/cli/cmd/output/task.go @@ -30,7 +30,7 @@ func (t *Task) AddLine(prefix string, line string) { if !t.lineAdded { fmt.Println() } - fmt.Println(ansiFaint, prefix, ansiReset, line) + fmt.Println(ansiReset+ansiFaint+prefix+ansiReset, line) t.lineAdded = true } diff --git a/cli/internal/app/deploy_events.go b/cli/internal/app/deploy_events.go index d527487..ea36376 100644 --- a/cli/internal/app/deploy_events.go +++ b/cli/internal/app/deploy_events.go @@ -52,7 +52,7 @@ func (s *Service) DeployEvents(ctx context.Context, input DeployEventsInput) err var handlerError error variables := map[string]any{"deployVersionID": GraphQLID(input.DeploymentVersionID)} - _, err := s.subscription.Subscribe(&DeployEventsSubscription{}, variables, func(message []byte, err error) error { + handler := func(message []byte, err error) error { if err != nil { return err } @@ -79,7 +79,9 @@ func (s *Service) DeployEvents(ctx context.Context, input DeployEventsInput) err } return nil - }) + } + + _, err := s.subscription.Subscribe(&DeployEventsSubscription{}, variables, handler) if err != nil { return nil }