diff --git a/apps/cli/main.go b/apps/cli/main.go index feed9c6..66a493d 100644 --- a/apps/cli/main.go +++ b/apps/cli/main.go @@ -12,6 +12,11 @@ import ( "github.com/urfave/cli/v2" ) +var ( + AppVersion string + AppName string +) + type Model string const ( @@ -27,13 +32,9 @@ type ConfigData struct { Model Model `json:"model"` } -var ( - AppVersion string - AppName string - CONFIG = config.NewConfig("genmoji", ConfigData{ - Model: GPT4oMini, - }) -) +var CONFIG = config.NewConfig("genmoji", ConfigData{ + Model: GPT4oMini, +}) func main() { upd := updater.NewUpdater(AppName, AppVersion, "segersniels") @@ -42,7 +43,6 @@ func main() { log.Printf("Failed to check for latest release %s\n\n", err) } - genmoji := NewGenmoji() app := &cli.App{ Name: AppName, Usage: "Generate commit messages for your staged changes", @@ -59,6 +59,7 @@ func main() { Name: "generate", Usage: "Generate a commit message", Action: func(ctx *cli.Context) error { + genmoji := NewGenmoji() response, err := genmoji.Generate() if err != nil { return err @@ -72,6 +73,7 @@ func main() { Name: "commit", Usage: "Generate a commit message and commit it", Action: func(ctx *cli.Context) error { + genmoji := NewGenmoji() return genmoji.Commit() }, },