MCPcopy Create free account
hub / github.com/dotzero/git-profile / profileDelete

Function profileDelete

cmd/del.go:93–107  ·  view source on GitHub ↗
(cmd *cobra.Command, cfg storage, filename string, profile string)

Source from the content-addressed store, hash-verified

91}
92
93func 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}

Callers 1

delCommandFunction · 0.85

Calls 4

PrintErrlnFunction · 0.92
PrintlnFunction · 0.92
DeleteProfileMethod · 0.65
SaveMethod · 0.65

Tested by

no test coverage detected