MCPcopy
hub / github.com/cli/cli / deleteRun

Function deleteRun

pkg/cmd/repo/deploy-key/delete/delete.go:45–67  ·  view source on GitHub ↗
(opts *DeleteOptions)

Source from the content-addressed store, hash-verified

43}
44
45func deleteRun(opts *DeleteOptions) error {
46 httpClient, err := opts.HTTPClient()
47 if err != nil {
48 return err
49 }
50
51 repo, err := opts.BaseRepo()
52 if err != nil {
53 return err
54 }
55
56 if err := deleteDeployKey(httpClient, repo, opts.KeyID); err != nil {
57 return err
58 }
59
60 if !opts.IO.IsStdoutTTY() {
61 return nil
62 }
63
64 cs := opts.IO.ColorScheme()
65 _, err = fmt.Fprintf(opts.IO.Out, "%s Deploy key deleted from %s\n", cs.SuccessIconWithColor(cs.Red), cs.Bold(ghrepo.FullName(repo)))
66 return err
67}

Callers 2

NewCmdDeleteFunction · 0.70
Test_deleteRunFunction · 0.70

Calls 7

FullNameFunction · 0.92
deleteDeployKeyFunction · 0.85
IsStdoutTTYMethod · 0.80
ColorSchemeMethod · 0.80
SuccessIconWithColorMethod · 0.80
BoldMethod · 0.80
BaseRepoMethod · 0.65

Tested by 1

Test_deleteRunFunction · 0.56