mirror of
https://github.com/drone/drone-cli.git
synced 2024-11-23 01:11:57 +01:00
refactor env variable declaration to one statement
This commit is contained in:
parent
9d0e93cc5d
commit
0bee92bd47
@ -2,7 +2,6 @@ package secret
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/drone/drone-cli/drone/internal"
|
||||
"github.com/drone/drone-go/drone"
|
||||
"github.com/drone/drone-go/plugin/secret"
|
||||
@ -53,15 +52,10 @@ var secretFindCmd = cli.Command{
|
||||
Usage: "plugin endpoint",
|
||||
EnvVar: "DRONE_SECRET_ENDPOINT",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "secret-secret",
|
||||
Usage: "plugin secret",
|
||||
EnvVar: "DRONE_SECRET_SECRET",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "secret",
|
||||
Usage: "plugin secret",
|
||||
EnvVar: "DRONE_SECRET_PLUGIN_TOKEN",
|
||||
EnvVar: "DRONE_SECRET_SECRET, DRONE_SECRET_PLUGIN_TOKEN",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "ssl-skip-verify",
|
||||
@ -103,14 +97,9 @@ func secretFind(c *cli.Context) error {
|
||||
Build: build,
|
||||
}
|
||||
|
||||
droneSecret := c.String("secret-secret")
|
||||
if droneSecret == ""{
|
||||
droneSecret = c.String("secret")
|
||||
}
|
||||
|
||||
client := secret.Client(
|
||||
c.String("endpoint"),
|
||||
droneSecret,
|
||||
c.String("secret"),
|
||||
c.Bool("ssl-skip-verify"),
|
||||
)
|
||||
res, err := client.Find(context.Background(), req)
|
||||
|
Loading…
Reference in New Issue
Block a user