diff --git a/command/providers.go b/command/providers.go index 3c1d144330..aeae44b15c 100644 --- a/command/providers.go +++ b/command/providers.go @@ -43,6 +43,13 @@ func (c *ProvidersCommand) Run(args []string) int { c.Ui.Error(fmt.Sprintf("Failed to load root config module: %s", err)) return 1 } + if root == nil { + c.Ui.Error(fmt.Sprintf( + "No configuration files found in the directory: %s\n\n"+ + "This command requires configuration to run.", + configPath)) + return 1 + } // Validate the config (to ensure the version constraints are valid) err = root.Validate()