| 609 | } |
| 610 | |
| 611 | func SetMkdocsRemoteActionFunc(ctx context.Context, cmd *cli.Command) error { |
| 612 | ghToken := strings.TrimSpace(cmd.String("github-token")) |
| 613 | if ghToken == "" { |
| 614 | return errors.New("empty github token") |
| 615 | } |
| 616 | |
| 617 | if err := os.Chdir(cmd.String("top-dir")); err != nil { |
| 618 | return err |
| 619 | } |
| 620 | |
| 621 | if err := runCmd(ctx, "git", "remote", "rm", "origin"); err != nil { |
| 622 | return err |
| 623 | } |
| 624 | |
| 625 | return runCmd( |
| 626 | ctx, |
| 627 | "git", "remote", "add", "origin", |
| 628 | fmt.Sprintf("https://x-access-token:%[1]s@github.com/urfave/cli.git", ghToken), |
| 629 | ) |
| 630 | } |
| 631 | |
| 632 | func LintActionFunc(ctx context.Context, cmd *cli.Command) error { |
| 633 | topDir := cmd.String("top-dir") |