Skip to content

Commit

Permalink
feat: add subcommand(g self update). #80
Browse files Browse the repository at this point in the history
  • Loading branch information
voidint committed Dec 4, 2022
1 parent 7b6456a commit b40c3b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,28 @@ var (
},
{
Name: "update",
Usage: "Fetch the newest version of g",
Usage: "Download and install updates to g",
UsageText: "g update",
Action: update,
Action: selfUpdate,
Hidden: true,
},
{
Name: "clean",
Usage: "Remove files from the package download directory",
UsageText: "g clean",
Action: clean,
},
{
Name: "self",
Usage: "Modify g itself",
Subcommands: []*cli.Command{
{
Name: "update",
Usage: "Download and install updates to g",
UsageText: "g self update",
Action: selfUpdate,
},
},
},
}
)
2 changes: 1 addition & 1 deletion cli/update.go → cli/self_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/voidint/g/pkg/sdk/github"
)

func update(*cli.Context) (err error) {
func selfUpdate(*cli.Context) (err error) {
up := github.NewReleaseUpdater()

// 检查更新
Expand Down

0 comments on commit b40c3b5

Please sign in to comment.