mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-05-05 00:00:31 -04:00
Since our new approach here works by installing with a synthetic module configuration block, we need to treat relative paths as a special case for two reasons: - Relative paths in module addresses are relative to the file containing the call rather than the working directory, but -from-module uses the working directory (and the call is in a synthetic "file" anyway) - We need to force Terraform to pass the path through to go-getter rather than just treating it as a relative reference, since we really do want a copy of the directory in this case, even if it is local. To address both of these things, we'll detect a relative path and turn it into an absolute path before beginning installation. This is a bit hacky, but this is consistent with the general philosophy of the -from-module implementation where it does hacky things so that the rest of the installer code can be spared of dealing with its special cases. This is covered by a couple of existing tests that run init -from-module, including TestInit_fromModule_dstInSrc which now passes.