Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Fix not finding .terraform dir in some circumstances (another attempt to solve some of #170) #197

Closed

Conversation

matthew16550
Copy link
Contributor

Added unit tests and moved the finding function to a new class because it felt wrong making ModuleDetectionUtil.getTerraformDirSomewhere() more visible just to test it.

Changed to use ProjectFileIndex.isInContent() instead of VfsUtilCore.isAncestor(project.baseDir, ...) because the later was causing trouble due to the dir structure of some of my TF projects.

Added caching to the finding function.

@@ -198,11 +199,6 @@ object ModuleDetectionUtil {


private fun getTerraformModulesManifestFile(project: Project, dotTerraform: VirtualFile): VirtualFile? {
val projectRoot = project.baseDir
if (projectRoot != null && !VfsUtilCore.isAncestor(projectRoot, dotTerraform, false)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this check as it has already been done in DotTerraformUtil.findTerraformDir().

@matthew16550 matthew16550 closed this by deleting the head repository May 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant