fix: mirror address not end with '/'

This commit is contained in:
Clark
2019-03-13 18:25:37 +08:00
parent 0d5e2c7a2f
commit 1c67b326f6

View File

@@ -36,12 +36,18 @@ func SetMirrors(node_mirror string, npm_mirror string){
if strings.ToLower(nodeBaseAddress[0:4]) != "http" {
nodeBaseAddress = "http://"+nodeBaseAddress
}
if !strings.HasSuffix(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 += "/"
}
}
}