Skip to content

Commit

Permalink
avoid extra newlines in verbose build output
Browse files Browse the repository at this point in the history
reset colors
  • Loading branch information
jfeodor committed Jun 10, 2024
1 parent 484aad9 commit 0b483a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions cli/cmd/deploy/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"numerous/cli/internal/app"
"numerous/cli/internal/gql"

"github.com/hasura/go-graphql-client"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/output/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
6 changes: 4 additions & 2 deletions cli/internal/app/deploy_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down

0 comments on commit 0b483a2

Please sign in to comment.