From 7eb591941c4469469f4ed14495d03f9dac2ee5a1 Mon Sep 17 00:00:00 2001 From: Steve Min Date: Tue, 8 May 2018 09:25:16 -0500 Subject: [PATCH] adding additional bool --- plugin.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugin.go b/plugin.go index f70b06f..1c4c141 100644 --- a/plugin.go +++ b/plugin.go @@ -32,6 +32,7 @@ type ( Parallelism int Targets []string VarFiles []string + PluginDir bool } Netrc struct { @@ -45,7 +46,7 @@ type ( BackendConfig []string `json:"backend-config"` Lock *bool `json:"lock"` LockTimeout string `json:"lock-timeout"` - PluginDir string `json:"plugin-dir` + PluginPath string `json:"plugin-path` } // Plugin represents the plugin instance to be executed @@ -206,9 +207,10 @@ func initCommand(config InitOptions) *exec.Cmd { args = append(args, fmt.Sprintf("-lock-timeout=%s", config.LockTimeout)) } - // "" is default in TF - if config.PluginDir != "" { - args = append(args, fmt.Sprintf("-plugin-dir=%s", config.PluginDir)) + if config.PluginDir == true { + if config.PluginPath != "" { + args = append(args, fmt.Sprintf("-plugin-dir=%s", config.PluginPath)) + } } // Fail Terraform execution on prompt