From f4af55d6119d0e2c62d3f2a0294e99193e47da3b Mon Sep 17 00:00:00 2001 From: Kristin Laemmert Date: Wed, 28 Aug 2019 11:57:05 -0400 Subject: [PATCH] command/console: use user-supplied plugin-dir (#22616) Previously `terraform console` would output an `init required` error if it was run in a directory originally `init`ed with a `-plugin-dir` specified. Fixes #17826 --- command/console.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/command/console.go b/command/console.go index 7d366fb2d..08c85d62f 100644 --- a/command/console.go +++ b/command/console.go @@ -40,6 +40,12 @@ func (c *ConsoleCommand) Run(args []string) int { return 1 } + // Check for user-supplied plugin path + if c.pluginPath, err = c.loadPluginPath(); err != nil { + c.Ui.Error(fmt.Sprintf("Error loading plugin path: %s", err)) + return 1 + } + var diags tfdiags.Diagnostics backendConfig, backendDiags := c.loadBackendConfig(configPath)