-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathmain.go
39 lines (30 loc) · 919 Bytes
/
main.go
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
31
32
33
34
35
36
37
38
39
package main
import (
"fmt"
"os"
"github.com/termkit/gama/internal/config"
gr "github.com/termkit/gama/internal/github/repository"
gu "github.com/termkit/gama/internal/github/usecase"
th "github.com/termkit/gama/internal/terminal/handler"
pkgversion "github.com/termkit/gama/pkg/version"
tea "github.com/charmbracelet/bubbletea"
)
const (
repositoryOwner = "termkit"
repositoryName = "gama"
)
var Version = "under development" // will be set by build flag
func main() {
cfg, err := config.LoadConfig()
if err != nil {
panic(fmt.Sprintf("failed to load config: %v", err))
}
version := pkgversion.New(repositoryOwner, repositoryName, Version)
githubRepository := gr.New(cfg)
githubUseCase := gu.New(githubRepository)
terminal := th.SetupTerminal(githubUseCase, version)
if _, err := tea.NewProgram(terminal).Run(); err != nil {
fmt.Println("Error running program:", err)
os.Exit(1)
}
}