diff --git a/internal/command/init.go b/internal/command/init.go index b8ba6b9ff..a44fba3dc 100644 --- a/internal/command/init.go +++ b/internal/command/init.go @@ -345,9 +345,10 @@ func (c *InitCommand) getModules(path string, earlyRoot *tfconfig.Module, upgrad installAbort, installDiags := c.installModules(path, upgrade, hooks) diags = diags.Append(installDiags) - if installAbort || installDiags.HasErrors() { - return true, true, diags - } + + // At this point, installModules may have generated error diags or been + // aborted by SIGINT. In any case we continue and the manifest as best + // we can. // Since module installer has modified the module manifest on disk, we need // to refresh the cache of it in the loader. @@ -362,7 +363,7 @@ func (c *InitCommand) getModules(path string, earlyRoot *tfconfig.Module, upgrad } } - return true, false, diags + return true, installAbort, diags } func (c *InitCommand) initCloud(root *configs.Module) (be backend.Backend, output bool, diags tfdiags.Diagnostics) { diff --git a/internal/command/meta_config.go b/internal/command/meta_config.go index 0abaf52a7..d19389283 100644 --- a/internal/command/meta_config.go +++ b/internal/command/meta_config.go @@ -178,8 +178,6 @@ func (m *Meta) installModules(rootDir string, upgrade bool, hooks initwd.ModuleI diags = diags.Append(fmt.Errorf("failed to create local modules directory: %s", err)) return true, diags } - // FIXME: KEM: does returning the abort here change behaviour in a particular error - // case? inst := m.moduleInstaller()