mirror of
https://github.com/drone/drone-cli.git
synced 2024-11-29 21:11:25 +01:00
3e2bf56d5e
Signed-off-by: Javier Palomo <javier.palomo@grafana.com>
29 lines
570 B
Go
29 lines
570 B
Go
package cron
|
|
|
|
import (
|
|
"github.com/drone/drone-cli/drone/internal"
|
|
"github.com/urfave/cli"
|
|
)
|
|
|
|
var cronDeleteCmd = cli.Command{
|
|
Name: "rm",
|
|
Usage: "deletes a cronjob",
|
|
ArgsUsage: "[repo/name] [cronjob]",
|
|
Action: cronDelete,
|
|
}
|
|
|
|
func cronDelete(c *cli.Context) error {
|
|
slug := c.Args().First()
|
|
owner, name, err := internal.ParseRepo(slug)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
client, err := internal.NewClient(c)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
cron := c.Args().Get(1)
|
|
client.CronDelete(owner, name, cron)
|
|
return client.CronDelete(owner, name, cron)
|
|
}
|