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

Function newCmdPluginDocsUpload

cli/cmd/plugin_docs_upload.go:28–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26)
27
28func newCmdPluginDocsUpload() *cobra.Command {
29 cmd := &cobra.Command{
30 Use: "upload [-D docs] [--sync] <team_name>/<plugin_kind>/<plugin_name>@<version>",
31 Short: pluginDocsUploadShort,
32 Long: pluginDocsUploadLong,
33 Example: pluginDocsUploadExample,
34 Args: cobra.ExactArgs(1),
35 RunE: func(cmd *cobra.Command, args []string) error {
36 // Set up a channel to listen for OS signals for graceful shutdown.
37 ctx, cancel := context.WithCancel(cmd.Context())
38
39 sigChan := make(chan os.Signal, 1)
40 signal.Notify(sigChan, syscall.SIGTERM)
41
42 go func() {
43 <-sigChan
44 cancel()
45 }()
46
47 return runPluginDocsUpload(ctx, cmd, args)
48 },
49 }
50 cmd.Flags().StringP("docs-dir", "D", "docs", "Path to the docs directory")
51 cmd.Flags().Bool("sync", false, "Synchronize docs with CloudQuery Hub, deleting any docs that are not present locally")
52
53 return cmd
54}
55
56func runPluginDocsUpload(ctx context.Context, cmd *cobra.Command, args []string) error {
57 tc := auth.NewTokenClient()

Callers 1

NewCmdRootFunction · 0.85

Calls 2

runPluginDocsUploadFunction · 0.85
ContextMethod · 0.45

Tested by

no test coverage detected