We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b30321c commit 1f248b0Copy full SHA for 1f248b0
main.go
@@ -53,12 +53,16 @@ func preferGitHub(args []string) {
53
}
54
55
address := args[1]
56
- if !strings.HasPrefix(address, "http") || !strings.HasPrefix(address, "git@") {
+ if !strings.HasPrefix(address, "http") && !strings.HasPrefix(address, "git@") {
57
args[1] = fmt.Sprintf("https://github.com.cnpmjs.org/%s", address)
58
59
60
61
func useMirror(args []string) {
62
+ // only for git clone
63
+ if len(args) < 2 || args[0] != "clone" {
64
+ return
65
+ }
66
for i, arg := range args {
67
if strings.Contains(arg, "github.com") && !strings.Contains(arg, "github.com.cnpmjs.org") {
68
args[i] = strings.ReplaceAll(arg, "github.com", "github.com.cnpmjs.org")
0 commit comments