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"),