MCPcopy Create free account
hub / github.com/dnote/dnote / newRun

Function newRun

pkg/cli/cmd/logout/logout.go:87–106  ·  view source on GitHub ↗
(ctx context.DnoteCtx)

Source from the content-addressed store, hash-verified

85}
86
87func newRun(ctx context.DnoteCtx) infra.RunEFunc {
88 return func(cmd *cobra.Command, args []string) error {
89 // Override APIEndpoint if flag was provided
90 if apiEndpointFlag != "" {
91 ctx.APIEndpoint = apiEndpointFlag
92 }
93
94 err := Do(ctx)
95 if err == ErrNotLoggedIn {
96 log.Error("not logged in\n")
97 return nil
98 } else if err != nil {
99 return errors.Wrap(err, "logging out")
100 }
101
102 log.Success("logged out\n")
103
104 return nil
105 }
106}

Callers 1

NewCmdFunction · 0.70

Calls 3

ErrorFunction · 0.92
SuccessFunction · 0.92
DoFunction · 0.70

Tested by

no test coverage detected