Skip to content

Commit

Permalink
CLI - fix bubble tea plain mode (#863)
Browse files Browse the repository at this point in the history
  • Loading branch information
alishakawaguchi authored Dec 13, 2023
1 parent 7ff514f commit 317d5b9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cli/internal/cmds/neosync/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type model struct {
}

var (
bold = lipgloss.NewStyle().PaddingLeft(2).Bold(true)
header = lipgloss.NewStyle().Faint(true).PaddingLeft(2)
printlog = lipgloss.NewStyle().PaddingLeft(2)
currentPkgNameStyle = lipgloss.NewStyle().PaddingLeft(2).Foreground(lipgloss.Color("211"))
Expand Down Expand Up @@ -274,6 +275,10 @@ func sync(
}

tables := getSchemaTables(schemaResp.Msg.GetSchemas())
if len(tables) == 0 {
fmt.Println(bold.Render("No tables found.")) // nolint
return nil
}
schemaMap := map[string]string{}
for _, t := range tables {
schemaMap[t.Schema] = t.Schema
Expand Down Expand Up @@ -313,7 +318,7 @@ func sync(
var opts []tea.ProgramOption
if outputType == output.PlainOutput {
// Plain mode don't render the TUI
opts = []tea.ProgramOption{tea.WithoutRenderer()}
opts = []tea.ProgramOption{tea.WithoutRenderer(), tea.WithInput(nil)}
} else {
// TUI mode, discard log output
log.SetOutput(io.Discard)
Expand Down

0 comments on commit 317d5b9

Please sign in to comment.