From 48f5eb80578f2e514286116622513adcef13407f Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 12 Apr 2017 18:31:37 +0200 Subject: [PATCH] added repo repair command --- drone/repo.go | 1 + drone/repo_repair.go | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 drone/repo_repair.go diff --git a/drone/repo.go b/drone/repo.go index c00a1f4d..a8154864 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 00000000..1169ce49 --- /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) +}