fix(cli): update environment variable handling for server URL
Some checks failed
CI / build-and-test (push) Failing after -32m44s
Some checks failed
CI / build-and-test (push) Failing after -32m44s
This commit is contained in:
@@ -54,6 +54,9 @@ func loadConfig() error {
|
||||
return err
|
||||
}
|
||||
cfg = loaded
|
||||
if v := strings.TrimSpace(os.Getenv("AMCS_SERVER")); v != "" {
|
||||
cfg.Server = v
|
||||
}
|
||||
if v := strings.TrimSpace(os.Getenv("AMCS_URL")); v != "" {
|
||||
cfg.Server = v
|
||||
}
|
||||
@@ -75,7 +78,7 @@ func loadConfig() error {
|
||||
|
||||
func requireServer() error {
|
||||
if strings.TrimSpace(cfg.Server) == "" {
|
||||
return fmt.Errorf("server URL is required; set --server, AMCS_URL, or config server")
|
||||
return fmt.Errorf("server URL is required; set --server, AMCS_SERVER, AMCS_URL, or config server")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user