2017-04-29 17:03:45 +00:00
|
|
|
package repo
|
2017-04-12 16:31:37 +00:00
|
|
|
|
|
|
|
import (
|
2017-04-29 17:03:45 +00:00
|
|
|
"github.com/drone/drone/drone/internal"
|
2017-04-12 16:31:37 +00:00
|
|
|
"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()
|
2017-04-29 17:03:45 +00:00
|
|
|
owner, name, err := internal.ParseRepo(repo)
|
2017-04-12 16:31:37 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2017-04-29 17:03:45 +00:00
|
|
|
client, err := internal.NewClient(c)
|
2017-04-12 16:31:37 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
return client.RepoRepair(owner, name)
|
|
|
|
}
|