refactored PR for fixing mirror URLs

This commit is contained in:
coreybutler
2021-09-11 01:15:47 -05:00

View File

@@ -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 + "/"
}
}
}