MCPcopy Create free account
hub / github.com/bufbuild/buf / run

Function run

cmd/buf/internal/command/plugin/pluginprune/pluginprune.go:50–80  ·  view source on GitHub ↗
(
	ctx context.Context,
	container appext.Container,
)

Source from the content-addressed store, hash-verified

48}
49
50func run(
51 ctx context.Context,
52 container appext.Container,
53) error {
54 dirPath := "."
55 if container.NumArgs() > 0 {
56 dirPath = container.Arg(0)
57 }
58 controller, err := bufcli.NewController(container)
59 if err != nil {
60 return err
61 }
62 workspaceDepManager, err := controller.GetWorkspaceDepManager(ctx, dirPath)
63 if err != nil {
64 return err
65 }
66 configuredRemotePluginRefs, err := workspaceDepManager.ConfiguredRemotePluginRefs(ctx)
67 if err != nil {
68 return err
69 }
70 return prune(
71 ctx,
72 xslices.Map(
73 configuredRemotePluginRefs,
74 func(pluginRef bufparse.Ref) string {
75 return pluginRef.FullName().String()
76 },
77 ),
78 workspaceDepManager,
79 )
80}
81
82func prune(
83 ctx context.Context,

Callers 1

NewCommandFunction · 0.70

Calls 6

NewControllerFunction · 0.92
pruneFunction · 0.70
StringMethod · 0.65
FullNameMethod · 0.65

Tested by

no test coverage detected