-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
30 lines (25 loc) · 727 Bytes
/
Copy pathmain.go
File metadata and controls
30 lines (25 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main
import (
"fmt"
"os"
"context"
appllicationDashboard "github.com/FredrikMWold/radix-tui/applicationDashboard"
"github.com/FredrikMWold/radix-tui/internal/radix"
tea "github.com/charmbracelet/bubbletea"
)
func main() {
// Helper mode: perform interactive login and exit
if os.Getenv("RADIX_TUI_LOGIN_HELPER") == "1" {
if client, err := radix.New(false); err == nil {
_ = client.LoginInteractive(context.Background())
}
return
}
model := appllicationDashboard.New()
// Enter alt-screen right away to minimize flicker and startup delay.
p := tea.NewProgram(model, tea.WithAltScreen())
if _, err := p.Run(); err != nil {
fmt.Printf("Alas, there's been an error: %v", err)
os.Exit(1)
}
}