command/show: config files are assumed to be in cwd

This commit is contained in:
Kristin Laemmert 2018-10-09 14:57:03 -07:00 committed by Martin Atkins
parent 97ac1dedba
commit a4c3022cf8
1 changed files with 8 additions and 7 deletions

View File

@ -45,12 +45,6 @@ func (c *ShowCommand) Run(args []string) int {
return 1 return 1
} }
configPath, err := ModulePath(cmdFlags.Args())
if err != nil {
c.Ui.Error(err.Error())
return 1
}
var diags tfdiags.Diagnostics var diags tfdiags.Diagnostics
// Load the backend // Load the backend
@ -69,9 +63,16 @@ func (c *ShowCommand) Run(args []string) int {
return 1 return 1
} }
// the show command expects the config dir to always be the cwd
cwd, err := os.Getwd()
if err != nil {
c.Ui.Error(fmt.Sprintf("Error getting cwd: %s", err))
return 1
}
// Build the operation // Build the operation
opReq := c.Operation(b) opReq := c.Operation(b)
opReq.ConfigDir = configPath opReq.ConfigDir = cwd
opReq.ConfigLoader, err = c.initConfigLoader() opReq.ConfigLoader, err = c.initConfigLoader()
if err != nil { if err != nil {
diags = diags.Append(err) diags = diags.Append(err)