Skip to content

Commit

Permalink
run tea program in the greeting cmd (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunNishimura committed Aug 5, 2023
1 parent 2dcbf13 commit d3c078a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 10 additions & 4 deletions cmd/greeting.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Copyright © 2023 NAME HERE <EMAIL ADDRESS>
package cmd

import (
"fmt"

"github.com/JunNishimura/Chatify/ui"
tea "github.com/charmbracelet/bubbletea"
"github.com/spf13/cobra"
)

Expand All @@ -14,8 +14,14 @@ func NewGreetingCommand() *cobra.Command {
Use: "greeting",
Short: "config setting for Chatify",
Long: "config setting for Chatify",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("greeting called")
RunE: func(cmd *cobra.Command, args []string) error {
p := tea.NewProgram(ui.NewModel(), tea.WithAltScreen())

if _, err := p.Run(); err != nil {
return err
}

return nil
},
}
}
4 changes: 0 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ func main() {

// check if token viper is set
if !isClientInfoSet() {
if err := askClientInfo(); err != nil {
log.Fatal(err)
}

authorize()
} else {
ctx := context.Background()
Expand Down

0 comments on commit d3c078a

Please sign in to comment.