MCPcopy Index your code
hub / github.com/cloudquery/cloudquery / newCmdPluginPublish

Function newCmdPluginPublish

cli/cmd/plugin_publish.go:33–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31)
32
33func newCmdPluginPublish() *cobra.Command {
34 cmd := &cobra.Command{
35 Use: "publish [-D dist]",
36 Short: pluginPublishShort,
37 Long: pluginPublishLong,
38 Example: pluginPublishExample,
39 Args: cobra.MaximumNArgs(1),
40 RunE: func(cmd *cobra.Command, args []string) error {
41 // Set up a channel to listen for OS signals for graceful shutdown.
42 ctx, cancel := context.WithCancel(cmd.Context())
43
44 sigChan := make(chan os.Signal, 1)
45 signal.Notify(sigChan, syscall.SIGTERM)
46
47 go func() {
48 <-sigChan
49 cancel()
50 }()
51
52 return runPluginPublish(ctx, cmd, args)
53 },
54 }
55 cmd.Flags().StringP("dist-dir", "D", "dist", "Path to the dist directory")
56 cmd.Flags().StringP("ui-dir", "U", "", "Path to the built plugin UI directory")
57 cmd.Flags().BoolP("finalize", "f", false, `Finalize the plugin version after publishing. If false, the plugin version will be marked as draft.`)
58
59 return cmd
60}
61
62func runPluginPublish(ctx context.Context, cmd *cobra.Command, args []string) error {
63 tc := auth.NewTokenClient()

Callers 1

NewCmdRootFunction · 0.85

Calls 2

runPluginPublishFunction · 0.85
ContextMethod · 0.45

Tested by

no test coverage detected