MCPcopy
hub / github.com/cortexlabs/cortex / getEnvConfigDefaults

Function getEnvConfigDefaults

cli/cmd/lib_cli_config.go:397–410  ·  view source on GitHub ↗
(envName string)

Source from the content-addressed store, hash-verified

395}
396
397func getEnvConfigDefaults(envName string) cliconfig.Environment {
398 defaults := cliconfig.Environment{}
399
400 prevEnv, err := readEnv(envName)
401 if err == nil && prevEnv != nil {
402 defaults = *prevEnv
403 }
404
405 if defaults.OperatorEndpoint == "" && os.Getenv("CORTEX_OPERATOR_ENDPOINT") != "" {
406 defaults.OperatorEndpoint = os.Getenv("CORTEX_OPERATOR_ENDPOINT")
407 }
408
409 return defaults
410}
411
412// If envName is "", this will prompt for the environment name to configure
413func configureEnv(envName string, fieldsToSkipPrompt cliconfig.Environment) (cliconfig.Environment, error) {

Callers 1

configureEnvFunction · 0.85

Calls 1

readEnvFunction · 0.85

Tested by

no test coverage detected