1
0
mirror of https://github.com/drone/drone-cli.git synced 2024-11-23 09:21:56 +01:00
drone-cli/drone/cron/cron_rm.go

29 lines
527 B
Go
Raw Normal View History

2018-08-07 01:29:03 +02:00
package cron
import (
"github.com/drone/drone-cli/drone/internal"
"github.com/urfave/cli"
)
var cronDeleteCmd = cli.Command{
Name: "rm",
Usage: "display cron rm",
ArgsUsage: "[repo/name]",
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
}
cronjob := c.Args().Get(1)
return client.CronDelete(owner, name, cronjob)
}