Skip to content

Commit

Permalink
change ghproxy.com to gh-proxy.com (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
LinuxSuRen authored Nov 9, 2023
1 parent 29520bf commit 207db33
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func NewRoot(cxt context.Context) (cmd *cobra.Command) {
for _, c := range cmd.Commands() {
registerFlagCompletionFunc(c, "provider", ArrayCompletion(ProviderGitHub, ProviderGitee))
registerFlagCompletionFunc(c, "proxy-github", ArrayCompletion("gh.api.99988866.xyz",
"ghproxy.com"))
"gh-proxy.com"))
registerFlagCompletionFunc(c, "os", ArrayCompletion("window", "linux", "darwin"))
registerFlagCompletionFunc(c, "arch", ArrayCompletion("amd64", "arm64"))
registerFlagCompletionFunc(c, "format", ArrayCompletion("tar.gz", "zip", "msi"))
Expand Down
2 changes: 1 addition & 1 deletion cmd/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (s *searchOption) addFlags(flags *pflag.FlagSet) {
flags.StringVarP(&s.Provider, "provider", "", viper.GetString("provider"), "The file provider")
flags.StringVarP(&s.ProxyGitHub, "proxy-github", "", viper.GetString("proxy-github"),
`The proxy address of github.com, the proxy address will be the prefix of the final address.
Available proxy: gh.api.99988866.xyz, ghproxy.com
Available proxy: gh.api.99988866.xyz, gh-proxy.com
Thanks to https://github.com/hunshcn/gh-proxy`)
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (o *setupOption) runE(cmd *cobra.Command, args []string) (err error) {
logger := log.GetLoggerFromContextOrDefault(cmd)

if o.proxy == "" {
if o.proxy, err = selectFromList([]string{"", "ghproxy.com", "gh.api.99988866.xyz"},
if o.proxy, err = selectFromList([]string{"", "gh-proxy.com", "gh.api.99988866.xyz"},
o.v.GetString("proxy-github"),
"Select proxy-github", o.stdio); err != nil {
return
Expand Down
4 changes: 2 additions & 2 deletions pkg/os/generic/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func TestSliceReplace(t *testing.T) {
installer := &CommonInstaller{}
installer.SetURLReplace(map[string]string{
"https://raw.githubusercontent.com": "https://ghproxy.com/https://raw.githubusercontent.com",
"https://raw.githubusercontent.com": "https://gh-proxy.com/https://raw.githubusercontent.com",
})

// a normal case
Expand All @@ -19,7 +19,7 @@ func TestSliceReplace(t *testing.T) {
"https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh",
})
assert.Equal(t, []string{"abc",
"https://ghproxy.com/https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"}, result)
"https://gh-proxy.com/https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"}, result)

// an empty slice
noProxyInstaller := &CommonInstaller{}
Expand Down

0 comments on commit 207db33

Please sign in to comment.