()
| 21 | ) |
| 22 | |
| 23 | func 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 | } |
no test coverage detected