(ctx context.Context, cmd *cli.Command)
| 566 | } |
| 567 | |
| 568 | func EnsureGfmrunActionFunc(ctx context.Context, cmd *cli.Command) error { |
| 569 | topDir := cmd.String("top-dir") |
| 570 | gfmrunExe := filepath.Join(topDir, ".local/bin/gfmrun") |
| 571 | |
| 572 | if err := os.Chdir(topDir); err != nil { |
| 573 | return err |
| 574 | } |
| 575 | |
| 576 | if v, err := sh(ctx, gfmrunExe, "--version"); err == nil && strings.TrimSpace(v) == gfmrunVersion { |
| 577 | return nil |
| 578 | } |
| 579 | |
| 580 | gfmrunURL, err := url.Parse( |
| 581 | fmt.Sprintf( |
| 582 | "https://github.com/urfave/gfmrun/releases/download/%[1]s/gfmrun-%[2]s-%[3]s-%[1]s", |
| 583 | gfmrunVersion, runtime.GOOS, runtime.GOARCH, |
| 584 | ), |
| 585 | ) |
| 586 | if err != nil { |
| 587 | return err |
| 588 | } |
| 589 | |
| 590 | return downloadFile(gfmrunURL.String(), gfmrunExe, 0o755, 0o755) |
| 591 | } |
| 592 | |
| 593 | func EnsureMkdocsActionFunc(ctx context.Context, cmd *cli.Command) error { |
| 594 | if err := os.Chdir(cmd.String("top-dir")); err != nil { |
nothing calls this directly
no test coverage detected