From b0f9b5b277c1baf9d0883c37cd1b2b0412ef218d Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 5 May 2020 09:36:22 +0800 Subject: [PATCH] remove load env file from urfave/cli Signed-off-by: Bo-Yi Wu --- main.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/main.go b/main.go index 3699cb1..6829adf 100644 --- a/main.go +++ b/main.go @@ -17,6 +17,11 @@ var ( ) func main() { + // Load env-file if it exists first + if filename, found := os.LookupEnv("PLUGIN_ENV_FILE"); found { + _ = godotenv.Load(filename) + } + defaultCiphers := []string{"aes128-ctr", "aes192-ctr", "aes256-ctr", "aes128-gcm@openssh.com", "arcfour256", "arcfour128", "aes128-cbc", "3des-cbc"} app := cli.NewApp() @@ -156,10 +161,6 @@ func main() { Usage: "build link", EnvVars: []string{"DRONE_BUILD_LINK"}, }, - &cli.StringFlag{ - Name: "env-file", - Usage: "source env file", - }, &cli.StringFlag{ Name: "proxy.ssh-key", Usage: "private ssh key of proxy", @@ -275,10 +276,6 @@ REPOSITORY: } func run(c *cli.Context) error { - if c.String("env-file") != "" { - _ = godotenv.Load(c.String("env-file")) - } - plugin := Plugin{ Repo: Repo{ Owner: c.String("repo.owner"),