find -plugin-dir during import

The import command wasn't loading the plugin path at all, relying on the
local directory for binaries.

Load the plugin dir into Meta, and pass in ForceLocal for consistency.
The Backend returned was going to be a Local anyway, so the added check
wasn't ensuring anything.
This commit is contained in:
James Bardin 2017-06-26 18:28:45 -04:00
parent 8e25830554
commit 0cbd51c365

View File

@ -112,9 +112,16 @@ func (c *ImportCommand) 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
}
// Load the backend
b, err := c.Backend(&BackendOpts{
Config: mod.Config(),
Config: mod.Config(),
ForceLocal: true,
})
if err != nil {
c.Ui.Error(fmt.Sprintf("Failed to load backend: %s", err))