harness-drone/drone/org_secret_rm.go

35 lines
523 B
Go
Raw Normal View History

2016-07-31 20:09:55 +00:00
package main
import (
"log"
2017-03-16 10:14:02 +00:00
"github.com/urfave/cli"
2016-07-31 20:09:55 +00:00
)
var orgSecretRemoveCmd = cli.Command{
Name: "rm",
Usage: "remove a secret",
Action: func(c *cli.Context) {
if err := orgSecretRemove(c); err != nil {
log.Fatalln(err)
}
},
}
func orgSecretRemove(c *cli.Context) error {
2016-08-14 22:02:11 +00:00
if len(c.Args()) != 2 {
2016-07-31 20:09:55 +00:00
cli.ShowSubcommandHelp(c)
return nil
}
team := c.Args().First()
secret := c.Args().Get(1)
client, err := newClient(c)
if err != nil {
return err
}
return client.TeamSecretDel(team, secret)
}