diff --git a/drone/repo.go b/drone/repo.go index c00a1f4d0..a8154864f 100644 --- a/drone/repo.go +++ b/drone/repo.go @@ -11,6 +11,7 @@ var repoCmd = cli.Command{ repoAddCmd, repoUpdateCmd, repoRemoveCmd, + repoRepairCmd, repoChownCmd, }, } diff --git a/drone/repo_repair.go b/drone/repo_repair.go new file mode 100644 index 000000000..1169ce496 --- /dev/null +++ b/drone/repo_repair.go @@ -0,0 +1,24 @@ +package main + +import ( + "github.com/urfave/cli" +) + +var repoRepairCmd = cli.Command{ + Name: "repair", + Usage: "repair repository webhooks", + Action: repoRepair, +} + +func repoRepair(c *cli.Context) error { + repo := c.Args().First() + owner, name, err := parseRepo(repo) + if err != nil { + return err + } + client, err := newClient(c) + if err != nil { + return err + } + return client.RepoRepair(owner, name) +}