added repo repair command

This commit is contained in:
Brad Rydzewski 2017-04-12 18:31:37 +02:00
parent 18bee1b84d
commit 48f5eb8057
2 changed files with 25 additions and 0 deletions

View file

@ -11,6 +11,7 @@ var repoCmd = cli.Command{
repoAddCmd,
repoUpdateCmd,
repoRemoveCmd,
repoRepairCmd,
repoChownCmd,
},
}

24
drone/repo_repair.go Normal file
View file

@ -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)
}