(hotfix) make sure app is initialized only when we need it
This commit is contained in:
@@ -5,24 +5,20 @@ import (
|
||||
|
||||
"github.com/LazyBachelor/LazyPM/internal/app"
|
||||
issues "github.com/LazyBachelor/LazyPM/internal/commands/issues"
|
||||
survey "github.com/LazyBachelor/LazyPM/internal/commands/survey"
|
||||
"github.com/charmbracelet/fang"
|
||||
)
|
||||
|
||||
var App *app.App
|
||||
var appCleanup func()
|
||||
var RootCmd = issues.RootCmd
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
app, cleanup, err := initializeServices(ctx)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
defer cleanup()
|
||||
|
||||
App = app
|
||||
survey.SetApp(App)
|
||||
issues.SetApp(App)
|
||||
defer func() {
|
||||
if appCleanup != nil {
|
||||
appCleanup()
|
||||
}
|
||||
}()
|
||||
|
||||
if err := fang.Execute(ctx, RootCmd,
|
||||
fang.WithColorSchemeFunc(fang.AnsiColorScheme)); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user