Files
gorc/main.go
T

57 lines
1.2 KiB
Go
Raw Normal View History

2021-10-10 21:36:04 +03:00
// gorc project
2022-01-24 04:24:58 +02:00
// Copyright (C) 2022 IllusionMan1212
2021-10-10 21:36:04 +03:00
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, see https://www.gnu.org/licenses.
package main
import (
"log"
tea "github.com/charmbracelet/bubbletea"
2023-02-19 00:58:42 +02:00
"github.com/illusionman1212/gorc/db"
"github.com/illusionman1212/gorc/ui/app"
2021-10-10 21:36:04 +03:00
)
func main() {
2022-01-24 01:25:01 +02:00
gorc := app.InitialState()
p := tea.NewProgram(
2022-01-24 01:25:01 +02:00
gorc,
tea.WithAltScreen(),
tea.WithMouseCellMotion(),
)
2023-02-19 00:58:42 +02:00
db, err := db.ConnectToDB()
if err != nil {
log.Fatal(err)
}
2022-01-24 01:25:01 +02:00
gorc.Client.Tea = p
2023-02-19 00:58:42 +02:00
gorc.Client.DB = db
f, err := tea.LogToFile("gorc.log", "gorc")
defer f.Close()
if err != nil {
log.Fatal(err)
}
err = p.Start()
if err != nil {
2022-02-19 16:24:39 +02:00
log.Fatal(err)
}
2021-10-10 21:36:04 +03:00
}