terragrunt
terragrunt copied to clipboard
`get_path_to_repo_root()` includes trailing slash unlike other functions
The path returned by get_path_to_repo_root()
includes a trailing /
where it looks like all other path functions do not. When building a source
based on this, it causes //
problems.
For instance, using the normal expression like this:
source = "${get_path_to_repo_root()}/modules//my-thing"
it actually resolves to the path ../..//modules//my-thing
. This causes the entire repo to get copied as the source. So, now I have to write my expression as:
source = "${get_path_to_repo_root()}modules//my-thing"
to get the expected path of ../../modules//my-thing
.
Correcting this will likely cause problems for folks. Either they lose the //
they currently expect or their existing expression (like my second example above) is no longer a valid path.
Created PR: https://github.com/gruntwork-io/terragrunt/pull/2212
Resolved in v0.51.1 release.