Skip to content

Commit

Permalink
Merge pull request #699 from hashicorp/b-fix-symlinks
Browse files Browse the repository at this point in the history
Avoid duplicate state entries (by avoiding symlink evaluation)
  • Loading branch information
radeksimko authored Nov 18, 2021
2 parents 371d8fd + 248373c commit 7d46fc6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/langserver/handlers/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func resolvePath(rootDir, rawPath string) (string, error) {
}

func cleanupPath(path string) (string, error) {
absPath, err := filepath.EvalSymlinks(path)
absPath, err := filepath.Abs(path)
return toLowerVolumePath(absPath), err
}

Expand Down
4 changes: 3 additions & 1 deletion internal/terraform/module/module_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ func (mm *moduleManager) AddModule(modPath string) (Module, error) {

err := mm.moduleStore.Add(modPath)
if err != nil {
return nil, err
if _, ok := err.(*state.AlreadyExistsError); !ok {
return nil, err
}
}

// TODO: Avoid returning new module, just the error from adding
Expand Down

0 comments on commit 7d46fc6

Please sign in to comment.