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_enable.go
2018-09-20 16:04:58 -07:00

29 lines
533 B
Go

package cron
import (
"github.com/drone/drone-cli/drone/internal"
"github.com/urfave/cli"
)
var cronEnableCmd = cli.Command{
Name: "enable",
Usage: "enable cron jobs",
ArgsUsage: "[repo/name]",
Action: cronEnable,
}
func cronEnable(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.CronDisable(owner, name, cronjob)
}