(cmd *cobra.Command, cfg storage, filename string, profile string)
| 91 | } |
| 92 | |
| 93 | func profileDelete(cmd *cobra.Command, cfg storage, filename string, profile string) error { |
| 94 | if ok := cfg.DeleteProfile(profile); !ok { |
| 95 | ui.PrintErrln(cmd, ui.ErrorStyle, "There is no profile with given name") |
| 96 | os.Exit(1) |
| 97 | } |
| 98 | |
| 99 | err := cfg.Save(filename) |
| 100 | if err != nil { |
| 101 | return err |
| 102 | } |
| 103 | |
| 104 | ui.Println(cmd, ui.SuccessStyle, "Successfully removed `%s` profile.\n", profile) |
| 105 | |
| 106 | return nil |
| 107 | } |
no test coverage detected