From d038b9e6cd8636e97a6844e45e8a0157a50ef8df Mon Sep 17 00:00:00 2001 From: Sarah French Date: Fri, 5 Jun 2026 14:47:46 +0100 Subject: [PATCH] docs: Add code comments to areas where refactoring to use (Meta).WorkingDir.RootModuleDir is not appropriate --- internal/command/meta.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/command/meta.go b/internal/command/meta.go index 6d2cc893a4..4f812ab652 100644 --- a/internal/command/meta.go +++ b/internal/command/meta.go @@ -847,6 +847,8 @@ func (m *Meta) applyStateArguments(args *arguments.State) { func (m *Meta) checkRequiredVersion() tfdiags.Diagnostics { var diags tfdiags.Diagnostics + // Cannot use m.WorkingDir.RootModuleDir() here because + // of path normalization that happens in loadConfig. pwd, err := os.Getwd() if err != nil { diags = diags.Append(fmt.Errorf("Error getting pwd: %s", err)) @@ -881,6 +883,8 @@ func (m *Meta) checkRequiredVersion() tfdiags.Diagnostics { func (c *Meta) MaybeGetSchemas(state *states.State, config *configs.Config) (*terraform.Schemas, tfdiags.Diagnostics) { var diags tfdiags.Diagnostics + // Cannot use m.WorkingDir.RootModuleDir() here because + // of path normalization that happens in loadConfig. path, err := os.Getwd() if err != nil { diags = diags.Append(tfdiags.SimpleWarning(failedToLoadSchemasMessage))