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
This commit is contained in:
Kristin Laemmert 2019-08-28 11:57:05 -04:00 committed by GitHub
parent bcc3af8173
commit f4af55d611
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -40,6 +40,12 @@ func (c *ConsoleCommand) Run(args []string) int {
return 1 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 var diags tfdiags.Diagnostics
backendConfig, backendDiags := c.loadBackendConfig(configPath) backendConfig, backendDiags := c.loadBackendConfig(configPath)