diff --git a/main.go b/main.go index 4680f0b..072d323 100644 --- a/main.go +++ b/main.go @@ -199,8 +199,8 @@ func main() { &cli.StringFlag{ Name: "envs.format", Usage: "", - EnvVars: []string{"PLUGIN_ENVS_FORMAT"}, - Value: "export {NAME}={VALUE}", + EnvVars: []string{"PLUGIN_ENVS_FORMAT", "INPUT_ENVS_FORMAT"}, + Value: envsFormat, }, } diff --git a/plugin.go b/plugin.go index 6ea1654..14d619f 100644 --- a/plugin.go +++ b/plugin.go @@ -17,6 +17,7 @@ var ( errMissingHost = errors.New("Error: missing server host") errMissingPasswordOrKey = errors.New("Error: can't connect without a private SSH key or password") errCommandTimeOut = errors.New("Error: command timeout") + envsFormat = "export {NAME}={VALUE}" ) type ( @@ -179,6 +180,10 @@ func (p Plugin) Exec() error { return errMissingPasswordOrKey } + if p.Config.EnvsFormat == "" { + p.Config.EnvsFormat = envsFormat + } + wg := sync.WaitGroup{} wg.Add(len(p.Config.Host)) errChannel := make(chan error)