fix: do not append trailing slash on empty server values

This commit is contained in:
Jose Diaz-Gonzalez
2021-08-05 12:04:18 -04:00
parent d4ec8d3ab5
commit 8f98bbc66f
2 changed files with 6 additions and 3 deletions

View File

@@ -124,4 +124,3 @@ dokku registry:set node-js-app push-on-release
# globally # globally
dokku registry:set --global push-on-release dokku registry:set --global push-on-release
``` ```

View File

@@ -17,11 +17,15 @@ func getRegistryServerForApp(appName string) string {
value = common.PropertyGet("registry", "--global", "server") value = common.PropertyGet("registry", "--global", "server")
} }
value = strings.TrimSuffix(value, "/") + "/" value = strings.TrimSuffix(value, "/")
if value == "hub.docker.com/" || value == "docker.io/" { if value == "hub.docker.com" || value == "docker.io" {
value = "" value = ""
} }
if value != "" {
value = value + "/"
}
return value return value
} }