Skip to content

Commit

Permalink
🐛 don't require env var when ran over sudo
Browse files Browse the repository at this point in the history
  • Loading branch information
segersniels committed Nov 18, 2024
1 parent fc96de0 commit e1341fa
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions apps/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import (
"github.com/urfave/cli/v2"
)

var (
AppVersion string
AppName string
)

type Model string

const (
Expand All @@ -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")
Expand All @@ -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",
Expand All @@ -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
Expand All @@ -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()
},
},
Expand Down

0 comments on commit e1341fa

Please sign in to comment.