Skip to content

Commit 6bcb832

Browse files
authored
Suppor to print the repo address (#78)
1 parent 64fe491 commit 6bcb832

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

.github/workflows/pull-request.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ jobs:
1717
id: go
1818
- name: Check out code into the Go module directory
1919
uses: actions/checkout@v2.3.4
20-
- name: Run GoReleaser
21-
uses: goreleaser/goreleaser-action@v2.4.1
22-
with:
23-
version: latest
24-
args: check
2520
- name: Build
2621
run: |
2722
go build

version/upgrade.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ func NewSelfUpgradeCmd(org, repo, name string, customDownloadFunc CustomDownload
3030
}
3131

3232
cmd = &cobra.Command{
33-
Use: "upgrade",
34-
Short: fmt.Sprintf("Upgrade %s itself", name),
33+
Use: "upgrade",
34+
Aliases: []string{"up"},
35+
Short: fmt.Sprintf("Upgrade %s itself", name),
3536
Long: fmt.Sprintf(`Upgrade %s itself
3637
You can use any exists version to upgrade %s itself. If there's no argument given, it will upgrade to the latest release.
3738
You can upgrade to the latest developing version, please use it like: %s version upgrade dev'`, name, name, name),

version/version.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ func NewVersionCmd(org, repo, name string, customDownloadFunc CustomDownloadFunc
1717
}
1818

1919
cmd = &cobra.Command{
20-
Use: "version",
21-
Short: fmt.Sprintf("Print the version of %s", name),
22-
Long: fmt.Sprintf("Print the version of %s", name),
23-
RunE: opt.RunE,
20+
Use: "version",
21+
Aliases: []string{"ver"},
22+
Short: fmt.Sprintf("Print the version of %s", name),
23+
Long: fmt.Sprintf("Print the version of %s", name),
24+
RunE: opt.RunE,
2425
}
2526

2627
flags := cmd.Flags()
@@ -43,6 +44,7 @@ func (o *PrintOption) RunE(cmd *cobra.Command, _ []string) (err error) {
4344
cmd.Printf("Version: %s\n", version)
4445
cmd.Printf("Last Commit: %s\n", GetCommit())
4546
cmd.Printf("Build Date: %s\n", GetDate())
47+
cmd.Printf("https://github.com/%s/%s", o.Org, o.Repo)
4648

4749
if strings.HasPrefix(version, "dev-") {
4850
version = strings.ReplaceAll(version, "dev-", "")

0 commit comments

Comments
 (0)