Skip to content

Commit

Permalink
✨ add update command
Browse files Browse the repository at this point in the history
  • Loading branch information
segersniels committed Nov 18, 2024
1 parent 2847824 commit aef4d16
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion apps/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/charmbracelet/huh"
"github.com/segersniels/config"
updater "github.com/segersniels/updater"
"github.com/urfave/cli/v2"
)

Expand Down Expand Up @@ -35,13 +36,25 @@ var (
)

func main() {
genmoji := NewGenmoji()
upd := updater.NewUpdater(AppName, AppVersion, "segersniels")
err := upd.CheckIfNewVersionIsAvailable()
if err != nil {
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",
Version: AppVersion,
Commands: []*cli.Command{
{
Name: "update",
Usage: "Update to the latest version",
Action: func(ctx *cli.Context) error {
return upd.Update()
},
},
{
Name: "generate",
Usage: "Generate a commit message",
Expand Down

0 comments on commit aef4d16

Please sign in to comment.