Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-chdir doesn't work with an absolute path #354

Open
OJFord opened this issue Jul 27, 2022 · 0 comments · May be fixed by #355
Open

-chdir doesn't work with an absolute path #354

OJFord opened this issue Jul 27, 2022 · 0 comments · May be fixed by #355

Comments

@OJFord
Copy link
Contributor

OJFord commented Jul 27, 2022

$tmpdir="$(mktemp -d)"
$echo 1.2.3 > "$tmpdir/.terraform-version"
$terraform -chdir="$tmpdir" init

Fails with:

cat: /home/ojf/code/tfenv/version: No such file or directory
Version could not be resolved (set by /home/ojf/code/tfenv/version or tfenv use )

The workaround is to ensure it's relative to the current working directory:

$terraform -chdir="$(realpath --relative-to="$PWD" "$tmpdir")" init
OJFord added a commit to OJFord/tfenv that referenced this issue Jul 27, 2022
OJFord added a commit to OJFord/tfenv that referenced this issue Jul 27, 2022
@OJFord OJFord linked a pull request Jul 27, 2022 that will close this issue
Zordrak pushed a commit to OJFord/tfenv that referenced this issue Oct 1, 2022
Zordrak pushed a commit to OJFord/tfenv that referenced this issue Oct 1, 2022
Zordrak pushed a commit to OJFord/tfenv that referenced this issue Oct 1, 2022
Zordrak pushed a commit to OJFord/tfenv that referenced this issue Oct 1, 2022
OJFord added a commit to OJFord/tfenv that referenced this issue Nov 4, 2022
OJFord added a commit to OJFord/tfenv that referenced this issue Nov 4, 2022
Stretch96 added a commit to dxw/dalmatian-tools that referenced this issue Nov 6, 2023
* When using the `-chdir` flag with terraform, tfenv doesn't respect the
  `.terraform-version` file if the paht is absolute: tfutils/tfenv#354
* This changes the path so that it is relative
Stretch96 added a commit to dxw/dalmatian-tools that referenced this issue Nov 6, 2023
* When using the `-chdir` flag with terraform, tfenv doesn't respect the
  `.terraform-version` file if the paht is absolute: tfutils/tfenv#354
* This changes the path so that it is relative
Zordrak pushed a commit to OJFord/tfenv that referenced this issue Dec 19, 2023
Zordrak pushed a commit to OJFord/tfenv that referenced this issue Dec 19, 2023
OJFord added a commit to OJFord/tfenv that referenced this issue Feb 10, 2024
OJFord added a commit to OJFord/tfenv that referenced this issue Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant