From a4c3022cf85005b17f1ee947b0b5c4f96d17e826 Mon Sep 17 00:00:00 2001 From: Kristin Laemmert Date: Tue, 9 Oct 2018 14:57:03 -0700 Subject: [PATCH] command/show: config files are assumed to be in cwd --- command/show.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/command/show.go b/command/show.go index e1ccf95acf..6d970f1bbb 100644 --- a/command/show.go +++ b/command/show.go @@ -45,12 +45,6 @@ func (c *ShowCommand) Run(args []string) int { return 1 } - configPath, err := ModulePath(cmdFlags.Args()) - if err != nil { - c.Ui.Error(err.Error()) - return 1 - } - var diags tfdiags.Diagnostics // Load the backend @@ -69,9 +63,16 @@ func (c *ShowCommand) Run(args []string) int { 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 opReq := c.Operation(b) - opReq.ConfigDir = configPath + opReq.ConfigDir = cwd opReq.ConfigLoader, err = c.initConfigLoader() if err != nil { diags = diags.Append(err)