mirror of
https://github.com/coreybutler/nvm-windows.git
synced 2026-01-14 07:03:17 +08:00
refactored PR for fixing mirror URLs
This commit is contained in:
@@ -43,12 +43,18 @@ func SetMirrors(node_mirror string, npm_mirror string) {
|
||||
if strings.ToLower(nodeBaseAddress[0:4]) != "http" {
|
||||
nodeBaseAddress = "http://" + nodeBaseAddress
|
||||
}
|
||||
if !strings.HasSuffix(nodeBaseAddress, "/") {
|
||||
nodeBaseAddress = nodeBaseAddress + "/"
|
||||
}
|
||||
}
|
||||
if npm_mirror != "" && npm_mirror != "none" {
|
||||
npmBaseAddress = npm_mirror
|
||||
if strings.ToLower(npmBaseAddress[0:4]) != "http" {
|
||||
npmBaseAddress = "http://" + npmBaseAddress
|
||||
}
|
||||
if !strings.HasSuffix(npmBaseAddress, "/") {
|
||||
npmBaseAddress = npmBaseAddress + "/"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user