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

Function writeCLIConfig

cli/cmd/lib_cli_config.go:624–638  ·  view source on GitHub ↗
(cliConfig cliconfig.CLIConfig)

Source from the content-addressed store, hash-verified

622}
623
624func writeCLIConfig(cliConfig cliconfig.CLIConfig) error {
625 if err := cliConfig.Validate(); err != nil {
626 return err
627 }
628
629 cliConfigBytes, err := yaml.Marshal(cliConfig)
630 if err != nil {
631 return errors.WithStack(err)
632 }
633 if err := files.WriteFile(cliConfigBytes, _cliConfigPath); err != nil {
634 return err
635 }
636
637 return nil
638}

Callers 5

setDefaultEnvFunction · 0.85
renameEnvFunction · 0.85
addEnvToCLIConfigFunction · 0.85
removeEnvFromCLIConfigFunction · 0.85
readCLIConfigFunction · 0.85

Calls 3

WithStackFunction · 0.92
WriteFileFunction · 0.92
ValidateMethod · 0.45

Tested by

no test coverage detected