Use new repo name for update notifier and changelog
This commit is contained in:
parent
25dc2b4a14
commit
1c74227ed7
3 changed files with 5 additions and 5 deletions
|
|
@ -13,7 +13,7 @@ builds:
|
||||||
- -s -w -X github.com/cli/cli/command.Version={{.Version}} -X github.com/cli/cli/command.BuildDate={{time "2006-01-02"}}
|
- -s -w -X github.com/cli/cli/command.Version={{.Version}} -X github.com/cli/cli/command.BuildDate={{time "2006-01-02"}}
|
||||||
- -X github.com/cli/cli/context.oauthClientID={{.Env.GH_OAUTH_CLIENT_ID}}
|
- -X github.com/cli/cli/context.oauthClientID={{.Env.GH_OAUTH_CLIENT_ID}}
|
||||||
- -X github.com/cli/cli/context.oauthClientSecret={{.Env.GH_OAUTH_CLIENT_SECRET}}
|
- -X github.com/cli/cli/context.oauthClientSecret={{.Env.GH_OAUTH_CLIENT_SECRET}}
|
||||||
- -X main.updaterEnabled=github/homebrew-gh
|
- -X main.updaterEnabled=cli/cli
|
||||||
goos:
|
goos:
|
||||||
- linux
|
- linux
|
||||||
- darwin
|
- darwin
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ func colorableErr(cmd *cobra.Command) io.Writer {
|
||||||
}
|
}
|
||||||
|
|
||||||
func changelogURL(version string) string {
|
func changelogURL(version string) string {
|
||||||
path := "https://github.com/github/homebrew-gh"
|
path := "https://github.com/cli/cli"
|
||||||
r := regexp.MustCompile(`^v\d+\.\d+.\d+$`)
|
r := regexp.MustCompile(`^v\d+\.\d+.\d+$`)
|
||||||
if !r.MatchString(version) {
|
if !r.MatchString(version) {
|
||||||
return fmt.Sprintf("%s/releases/latest", path)
|
return fmt.Sprintf("%s/releases/latest", path)
|
||||||
|
|
|
||||||
|
|
@ -7,21 +7,21 @@ import (
|
||||||
|
|
||||||
func TestChangelogURL(t *testing.T) {
|
func TestChangelogURL(t *testing.T) {
|
||||||
tag := "v0.3.2"
|
tag := "v0.3.2"
|
||||||
url := fmt.Sprintf("https://github.com/github/homebrew-gh/releases/tag/v0.3.2")
|
url := fmt.Sprintf("https://github.com/cli/cli/releases/tag/v0.3.2")
|
||||||
result := changelogURL(tag)
|
result := changelogURL(tag)
|
||||||
if result != url {
|
if result != url {
|
||||||
t.Errorf("expected %s to create url %s but got %s", tag, url, result)
|
t.Errorf("expected %s to create url %s but got %s", tag, url, result)
|
||||||
}
|
}
|
||||||
|
|
||||||
tag = "0.3.5-90-gdd3f0e0"
|
tag = "0.3.5-90-gdd3f0e0"
|
||||||
url = fmt.Sprintf("https://github.com/github/homebrew-gh/releases/latest")
|
url = fmt.Sprintf("https://github.com/cli/cli/releases/latest")
|
||||||
result = changelogURL(tag)
|
result = changelogURL(tag)
|
||||||
if result != url {
|
if result != url {
|
||||||
t.Errorf("expected %s to create url %s but got %s", tag, url, result)
|
t.Errorf("expected %s to create url %s but got %s", tag, url, result)
|
||||||
}
|
}
|
||||||
|
|
||||||
tag = "deadbeef"
|
tag = "deadbeef"
|
||||||
url = fmt.Sprintf("https://github.com/github/homebrew-gh/releases/latest")
|
url = fmt.Sprintf("https://github.com/cli/cli/releases/latest")
|
||||||
result = changelogURL(tag)
|
result = changelogURL(tag)
|
||||||
if result != url {
|
if result != url {
|
||||||
t.Errorf("expected %s to create url %s but got %s", tag, url, result)
|
t.Errorf("expected %s to create url %s but got %s", tag, url, result)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue