MCPcopy
hub / github.com/urfave/cli / EnsureMkdocsActionFunc

Function EnsureMkdocsActionFunc

scripts/build.go:593–609  ·  view source on GitHub ↗
(ctx context.Context, cmd *cli.Command)

Source from the content-addressed store, hash-verified

591}
592
593func EnsureMkdocsActionFunc(ctx context.Context, cmd *cli.Command) error {
594 if err := os.Chdir(cmd.String("top-dir")); err != nil {
595 return err
596 }
597
598 if err := runCmd(ctx, "mkdocs", "--version"); err == nil {
599 return nil
600 }
601
602 if cmd.Bool("upgrade-pip") {
603 if err := runCmd(ctx, "pip", "install", "-U", "pip"); err != nil {
604 return err
605 }
606 }
607
608 return runCmd(ctx, "pip", "install", "-r", "mkdocs-requirements.txt")
609}
610
611func SetMkdocsRemoteActionFunc(ctx context.Context, cmd *cli.Command) error {
612 ghToken := strings.TrimSpace(cmd.String("github-token"))

Callers

nothing calls this directly

Calls 3

runCmdFunction · 0.85
BoolMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected