tfenv icon indicating copy to clipboard operation
tfenv copied to clipboard

-chdir doesn't work with an absolute path

Open OJFord opened this issue 3 years ago • 0 comments

$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 avatar Jul 27 '22 18:07 OJFord