MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / newConfigSaveCmd

Function newConfigSaveCmd

app/cli/cmd/config_save.go:23–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21)
22
23func newConfigSaveCmd() *cobra.Command {
24 cmd := &cobra.Command{
25 Use: "save",
26 Short: "Persist the current settings to the config file",
27 Example: "chainloop config save --control-plane localhost:1234 --artifact-cas localhost:1235",
28 Annotations: map[string]string{
29 skipActionOptsInit: trueString,
30 },
31 RunE: func(cmd *cobra.Command, args []string) error {
32 // Process CA flags - read file contents and encode to base64 if needed
33 if err := processCAFlag(confOptions.controlplaneCA); err != nil {
34 return err
35 }
36 if err := processCAFlag(confOptions.CASCA); err != nil {
37 return err
38 }
39 return viper.WriteConfig()
40 },
41 }
42
43 return cmd
44}

Callers 1

newConfigCmdFunction · 0.85

Calls 1

processCAFlagFunction · 0.85

Tested by

no test coverage detected