1
0
mirror of https://github.com/writeas/writeas-cli synced 2025-07-26 23:08:16 +00:00

newClient must prepend scheme to default host

this updates newClient to prepend the scheme https to the default host
found in the global config, and only use said host when both the user
and host are configured
This commit is contained in:
Rob Loranger 2019-08-08 09:22:31 -07:00
parent 72dbd1c7ef
commit 836eea7dab
No known key found for this signature in database
GPG Key ID: D6F1633A4F0903B8

View File

@ -34,8 +34,8 @@ func newClient(c *cli.Context) (*writeas.Client, error) {
}
if host := HostURL(c); host != "" {
clientConfig.URL = host + "/api"
} else if cfg.Default.Host != "" {
clientConfig.URL = cfg.Default.Host + "/api"
} else if cfg.Default.Host != "" && cfg.Default.User != "" {
clientConfig.URL = "https://" + cfg.Default.Host + "/api"
} else if config.IsDev() {
clientConfig.URL = config.DevBaseURL + "/api"
} else if c.App.Name == "writeas" {